Russia is about to end its military operation in Syria that tipped the scales in the devastating war in favour of government forces, President Vladimir Putin has said.
The Russian leader was speaking at surprise talks with Syrian president Bashar Assad.
Mr Putin hosted Mr Assad in the Black Sea resort of Sochi yesterday ahead of a summit between Russia, Turkey and Iran and a new round of Syria peace talks in Geneva.
The meeting was unannounced and the Kremlin did not make it public until this morning.
"I passed to (Putin) and all Russian people our greetings and gratitude for all of the efforts that Russia made to save our country," Mr Assad told Russia's top brass.
Mr Assad has only ventured outside his war-ravaged nation twice since the conflict began, both times to Russia.
This week's visit to meet Mr Putin is his second since the crisis began in March 2011 leading to a civil war that has killed some 400,000 and resulted in millions of refugees.
The first was in October 2015, shortly after Russia launched its military campaign in Syria to shore up Mr Assad's forces.
The Russian intervention has turned the war in favour of Mr Assad.
With the Syrian government controlling most of the country and Islamic State fighter in disarray Mr Putin told Mr Assad at the Monday meeting that Moscow is about to curtail its military presence there.
"Regarding our joint operation to fight terrorists in Syria, this military operation is indeed coming to an end," he told Mr Assad in televised remarks.
"I'm pleased to see your willingness to work with everyone who wants peace and settlement."
Footage and photographs released by the Kremlin press office showed Mr Putin giving Mr Assad a warm embrace upon his arrival at Mr Putin's residence in Sochi.
Russian television showed footage of Mr Putin and Mr Assad entering a meeting with the top brass of Russia's defence ministry and the general staff.
"I asked the Syrian president to stop by," Mr Putin told the Russian generals.
He then referred to Mr Assad and said: "I would like to introduce you to people who played a key role in saving Syria."
The meeting came two days after Syrian troops and their allies captured the eastern town of Boukamal, the last major inhabited area held by the IS group in Syria.
Syrian troops and their Iran-backed allies marched into the town under the cover of Russian air strikes.
The meeting in Sochi comes ahead of a summit scheduled on Wednesday in Russia between the presidents of Iran, Russia and Turkey.
Iran and Russia have been Mr Assad's main backers while Turkey supports the opposition.