In November, Syrian leader Bashar al-Assad traveled to Russia to literally hug Russian President Vladimir Putin for helping him stay in power during the country’s civil war. On Monday, Putin flew to Syria to celebrate what is effectively the defeat of the rebels that had spent years fighting to oust Assad.

Putin said that he would order a “significant” withdrawal of Russian troops from Syria now that the two militaries had defeated what he called a “lethal group of international terrorists,” but acknowledged that at least two of his bases will remain open. The Russian leader has announced a drawdown at least once before, but there was no noticeable decrease in troops.

"If terrorists will raise their heads ever again, we will strike them with such force that they have never seen before," he also said in his remarks on Monday.

Putin’s wording is really important because it highlights a key part of the way that he and Assad have justified the brutal tactics in a war that has killed upward of 465,000 people and triggered the biggest refugee crisis since World War II. The two men have redefined all of the rebels fighting to unseat Assad — including moderate and secular forces supported by the US — as “terrorists.” That rhetorical sleight of hand has given them cover for a campaign of largely indiscriminate violence.

Despite international condemnation, Assad has been waging a war for the past six years against rebel groups. Putin, one of his only allies, started providing him with much military support and assistance about two years ago.

Putin’s bravado is also a way for him to declare a foreign policy victory as he begins his campaign to become Russia’s president — for the fourth time.

“Like everything else Vladimir Putin does, the objective is to influence Russian domestic politics,” Fred Hof, a former adviser on Syria to Barack Obama who is now at the Atlantic Council, told me in an interview. Because the Russian presidential elections start in March 2018, claiming victory in Syria allows Putin to tell his domestic audience that his efforts during the war were worth it.

But the fact that Assad remains in power may be the only real testament Putin needs to show that Russia’s intervention in the war worked.

Putin may be the reason that Assad is still in control of Syria today

The US has been trying to remove Assad since the Obama administration, though Washington hasn’t been willing to devote many troops or resources to the fight, nor to train significant numbers of rebels. Putin — and the Russian investment — has made sure that Assad kept his job.

Russia started its air campaign in Syria near the end of September 2015, under the guise that it was targeting terrorists, even though it was helping Assad bomb civilians in hospitals and schools. The US, meanwhile, was in the middle of its own air war supporting a variety of armed groups trying to overthrow the Syrian leader.

Both countries agreed last month to fight on opposite sides of a 45-mile stretch of the Euphrates River and deconflict their respective air campaigns — but there still have been some close calls that could’ve escalated tensions. As the New York Times reported on Friday, Russia violates the agreement about six times a day, and in some instances US and Russian have come close to crashing into each other. The Times notes that in one case two US warplanes nearly collided with a Russian jet that was just 300 feet away until the American pilots quickly changed course.

As my colleague Yochi Dreazen noted last month, Russia is deeply invested in keeping Assad in power. Moscow has poured money, weapons, and troops into the country, helping Assad rapidly to reclaim territory from the rebel groups and deal them a string of battlefield defeats. The biggest blow came last December, when Assad retook Aleppo, one of Syria’s biggest cities and a longtime rebel stronghold.

Trump has stepped up its involvement in Syria, including its close calls with Russia on the battlefield. But Trump, like Obama, has done nothing of any real significance to push Assad out. He vacillated for months about whether the Syrian president needed to eventually give up power before Assad forced Trump’s hand by once again using chemical weapons against his own people. Trump responded with a cruise missile strike against a Syrian military airstrip and renewed calls for Assad’s ouster, but that’s been about it.

Putin has for a long time been willing to do more, risk more, and lose more to keep Assad in power. Those efforts have paid off, and the Russian leader has gone to Syria to claim victory.