Syria’s President Bashar al-Assad has visited Moscow on his first overseas trip since the civil war broke out in his country in 2011, state TV says.
During the surprise visit, he held talks with President Vladimir Putin.
Russia launched air strikes in Syria last month against the so-called Islamic State and other militant groups battling Mr Assad’s forces.
Mr Assad said Russia’s involvement had stopped the spread of “terrorism” becoming “more widespread and harmful”.
For his part, Mr Putin said the Syrian people had been “almost alone… resisting, fighting international terrorism for several years”.
“They had suffered serious losses, but recently have been achieving serious results in this fight,” he said.
The visit happened on Tuesday evening, but was not announced until Wednesday – after Mr Assad had returned to Damascus.
Analysis: Diplomatic correspondent Jonathan Marcus
President Assad’s surprise visit to Moscow represents a sign of growing confidence for the embattled Syrian president.
Firstly, he feels it safe to leave Damascus for the first time since the civil war in Syria erupted.
It is also a visible symbol of Russia’s confidence in the current Syrian regime. Having Mr Assad turn up in Moscow shows that there is little doubt that for now at least, President Putin is intent on shoring up Mr Assad’s position.
But the trip may also mark a new stage in Russia’s efforts to roll out a diplomatic plan alongside its military intervention in Syria; an illustration that Russia deals with Mr Assad, and that for now at least Mr Assad has to be part of any interim solution.
In comments that were videoed and published by the Kremlin, Mr Putin thanked Mr Assad for coming despite the “dramatic situation” back home.
He said Moscow had joined the fight against “international terrorism”, not just to help the Syrian people, but to better protect Russians too.
He said some 4,000 people from the former Soviet Union were believed to be fighting in Syria right now. “We cannot permit them – once they get fighting experience there and ideological training – to turn up here in Russia,” he said.
Mr Assad thanked Russia for “standing up for the unity of Syria and its independence”, and said its intervention had “prevented the events in Syria from developing along a more tragic scenario”.
Terrorism is a real obstacle to a political solution,” said Mr Assad, “and of course the whole (Syrian) people want to take part in deciding the fate of their state, and not just the leadership.”
Both men spoke of the need for a political solution to the crisis.
Mr Putin said Russia stood “ready to contribute” to any political process that could bring about a peaceful resolution.