Syria's Bashar Assad made a surprise visit to Russia to express thanks for Moscow’s help in the fight against terrorism. At a meeting with President Putin, which began with an embrace, the leaders discussed the Syrian political settlement ahead of Moscow's talks with Iran and Turkey.

The visit by President Assad to the Black Sea resort of Sochi was not revealed until Tuesday, after he had already left Russia. Footage and photos released by the Kremlin after the event show the Syrian leader, dressed in a dark grey suit and light grey tie, embracing Vladimir Putin and shaking his hand on the porch of a presidential residence in the southern Russian city. The two leaders then moved inside for a photo op and formal greeting speeches, before a nearly three-hour round of talks behind closed doors. Afterwards, Putin took his Syrian guest to meet Russian generals who were in Sochi to take part in defense-related government talks.

“I’d like to introduce you to the people who played a key part in saving Syria,” Putin told Assad as he introduced the men in green uniforms. “Of course, Mr. Assad knows some of you personally. He told me during our talks today that thanks to the Russian Army, Syria has been saved as a state.”

Assad used the opportunity to relay the gratitude of his government and the Syrian people to those involved in the two-year operation in the war-torn nation. “I would like to underline the effort made by the armed forces of the Russian Federation, the sacrifices they have made,” he said.

In 2015, Russia sent its warplanes to help Damascus fight against extremist Islamist forces trying to overthrow the government. The operation prevented a collapse of the secular Syrian state, and paved the way for a political dialogue with opposition groups who see a future for Syria not based on extremist ideology.

The joint Russian-Syrian military operation took place in parallel with diplomatic efforts to establish a ceasefire in large parts of Syria and facilitate direct negotiations between the government and moderate opposition. Turkey and Iran played a crucial role in negotiating the so-called “de-escalation zones” and are actively involved in furthering a political transition in Syria.

READ MORE: Putin: One day weapons go to ‘moderate opposition,’ the next they are with terrorists

The Monday visit by Assad comes two days ahead of a meeting between Putin, Turkish President Recep Tayyip Erdogan and Iranian President Hassan Rouhani in Sochi. The meeting with Assad was intended to ensure that “whatever decisions would be reached [with Erdogan and Rouhani] are viable,” Kremlin spokesman Dmitry Peskov told the media on Tuesday.

Also on Monday, Syrian opposition figure Riyad Hijab announced his resignation as chair of the Saudi-backed umbrella group, the High Negotiations Committee (HNC). Several other members also left, in a move welcomed by Russian Foreign Minister Sergey Lavrov on Tuesday.

“The retreat of radically minded opposition figures from playing the main role will make it possible to unite this motley opposition – internal and external – on a more reasonable, realistic and constructive platform,” Lavrov told journalists.

READ MORE: Absurdities of Syrian war propaganda

The resignations came as the committee was gathering for a meeting in Riyadh on Wednesday. The HNC is expected to select a delegation for the upcoming round of UN-sponsored Syria peace talks in Geneva next week.