To many observers, the image of Russian President Vladimir Putin sharing a warm embrace with Syrian leader Bashar Assad during a surprise meeting between the two leaders seemed to serve as a coda to a Russian military campaign that has reversed the course of a ferocious war now in its seventh year.
Indeed, the two leaders have much to celebrate. When Putin dispatched warplanes and special forces advisors to Syria in 2015 to halt a rebel advance, Islamic State militants were firmly entrenched and Assad's government was teetering on the brink of collapse. President Obama was calling on the Syrian president to resign.
Today, forces loyal to Assad control more than half the country, including almost all major cities, and there is a growing diplomatic consensus that Assad's opponents will have to accept a continuation of his rule as they chart a course to end the war that has killed hundreds of thousands and displaced millions.
At the previously unannounced meeting in the Black Sea resort of Sochi, made public Tuesday, Putin informed Assad that Moscow's military role in Syria is now coming to an end.
"As far as our joint efforts against the terrorists in Syria, this military operation is nearing completion," Putin said.
The main task now, the Russian leader said, is to launch a "political process" to push forward a peace plan, presumably one that will solidify Moscow's aims in the Middle East.
The encounter marked a major victory for Putin and — though President Trump put a positive cast on it — a humiliating loss for several years of U.S. policy, which included funneling money and expertise to an array of Syrian forces fighting for Assad's ouster.
Washington's failure to see Assad replaced years ago with a democratically elected government has several explanations. Some of the rebels the U.S. was backing worked too closely with groups that the U.S. considers to be terrorists, complicating the ability to deliver the arms and money needed to win. Successive administrations also underestimated Assad's resilience, the fractious nature of the Syrian opposition and the decisive role that Putin would ultimately assume.
Then the Trump administration changed the rules of the game. Ousting Assad was no longer the goal — in any case that seemed increasingly unlikely to happen — and defeating Islamic State militants was all anyone talked about.
Russia entered the multi-sided civil war in Syria in the fall of 2015, ostensibly to help rid the country of Islamic State, but it also directed its air power against other groups that oppose Assad.
Alliances led by Russia and the United States have now driven Islamic State from most of the territory it once controlled, though other insurgent groups still hold patches of territory near the Syrian capital, Damascus, in the north of the country and along the border with Jordan.
Although Putin signaled that he is wrapping up his campaign in Syria, he made no mention of scaling down Russia's military presence, something the Kremlin has in the past said it would do, without following through.
In 2016, Putin ordered a withdrawal from Syria, saying "all the tasks have been accomplished." It never happened. In January, Russia said it was pulling its aircraft carrier and other warships from the waters off Syria. But as recently as this fall, it still had such vessels in the area.
"Keep in mind that Russia now has a major military presence in Syria at least for the next 49 years through its expanded bases in Tartus and in Khmeimim," said Anna Borshchevskaya, a fellow at the Washington Institute for Near East Policy who focuses on Russia's policy in the Middle East.
"What they want to do is limit the ability of Western countries to operate militarily in Syria and they are doing that by establishing their own military presence."
Having largely achieved his military objectives, analysts say, Putin is now in a position to craft a political settlement in Syria on his terms and is hosting a series of meetings ahead of the resumption of United Nations-sponsored talks in Geneva next week.
On Monday, Putin discussed with Assad terms of a possible agreement to be presented at a summit between Russia, Iran and Turkey scheduled for Wednesday at the same venue, according to the Kremlin. Iran is another key backer of Assad, while Turkey supports elements of the opposition.
Putin later called President Trump to inform him about the talks, saying Assad has agreed to abide by a political settlement for Syria, including constitutional reform and the holding of parliamentary and presidential elections. Exactly when that would happen was not clear.
Trump called it a "great call," telling reporters, "We're talking very strongly about bringing peace for Syria."
But analysts said the Kremlin's moves in Syria only accentuate America's declining influence in the region.
"The United States is not playing an active role in how this conflict gets resolved, and the terms will matter," said Jon Alterman, director of the Middle East Program at the Center for Strategic and International Studies, a Washington think tank. "The terms are being negotiated with the United States not really at the table."
In addition to the call with Trump, Putin also called Saudi Arabia's King Salman ahead of a meeting scheduled Wednesday by the Syrian opposition in the Saudi capital, Riyadh.
Assad's visit to Russia came as several leading figures quit the opposition's top umbrella group in protest of pressure to accept a continued role for Assad.
"I find myself today forced to declare my resignation from the High Negotiations Committee, wishing for it more achievement," said its head, Riyad Hijab, in a statement Monday on Twitter, insisting that he and the other members had worked against attempts to "lengthen the life of the … Assad regime."
His sentiment was echoed by Suheir Atassi, a longtime member of the body who also resigned Monday.
"The dispute among nations is how long Assad can stay, and whether he can run for the presidency again, and his powers if he remains president, and not his departure," Atassi said in a statement to the Khaleej Online news outlet.
Those who quit said they were also motivated by the inclusion of rival opposition groupings that critics say are too close to the Syrian government.
"They want us to form a delegation from the regime to negotiate with the regime," Osama Abu Zaid, a legal advisor to the rebels, said by phone Tuesday. "It's a strange thing."
Russian Foreign Minister Sergei Lavrov welcomed the resignations, saying he expected "the retreat of the radical opposition leaders to the background [will] help the Syria-based and foreign-based opposition to unite on a constructive basis," according to the Russian state news agency Tass.
Borshchevskaya cautioned, however, that while Russia may be able to craft a short-term fix for Syria, "it's not going to lead to long-term stability and peace because there will be no reconciliation or reconstruction."
A successful end to Russia's military campaign in Syria would play well for Putin domestically ahead of presidential elections scheduled for next year. While he has not announced his intentions yet, it is widely expected that Putin will seek — and probably win — a fourth term.
"For 20 years, Western countries have been trying to decrease Russia's influence in the world," said Pavel Zolotarev, a vice director of the U.S. Institute at the Russian Academy of Sciences. "In Ukraine, Western countries crossed the red line with Russia, and since then Russia has had to answer and start regaining its influence in the Black Sea region and the Middle East, among other places in the world."
Ayres reported from Moscow, Zavis from Beirut and Wilkinson from Washington. Times staff writers Laura King and Noah Bierman in Washington and special correspondent Nabih Bulos in Amman, Jordan, contributed to this report.
7:55 p.m.: This article was updated with additional details on opposition talks and analysis about the role of the U.S. and Russia.
11:05 a.m.: This article was updated with staff reporting.
Nov. 21, 4:42 a.m.: This article was updated with additional details on the meeting and background