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 said at surprise talks with Syrian President Bashar Assad.

Putin hosted Assad in the Black Sea resort of Sochi on Monday 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 Tuesday 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,” Assad told Russia's top brass.

Assad has only ventured outside his war-ravaged nation twice since the conflict began both times to Russia.

This week's visit to meet 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 Assad's forces. The Russian intervention has turned the war in favour of Assad.

With the Syrian government controlling most of the country and the militant Islamic State group fighters in disarray Putin told 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 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 Putin giving Assad a warm embrace upon his arrival at Putin's residence in Sochi.

Russian television showed footage of Putin and 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,” Putin told the Russian generals. He then referred to 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 airstrikes.

The meeting in Sochi comes ahead of a summit scheduled on Wednesday in Russia between the presidents of Iran, Russia and Turkey. Putin will also inform Saudi Arabia of his meeting with Assad, Arab News reported.

Iran and Russia have been Assad's main backers while Turkey supports the opposition.