Few things are more irritating to leaders than having a foreign head of state lecture them about what is in their best interests.

Recall this bit of unsolicited advice that former president Barack Obama directed in October 2015 at Russian President Vladimir Putin, who had just ordered a bombing campaign against Syrian rebels opposed to President Bashar al-Assad. At a White House news conference, Obama had stated: “An attempt by Russia and Iran to prop up Assad and try to pacify the population is just going to get them stuck in a quagmire and it won’t work.”

Two years later, Russia and Iran can delight in the fact that their intervention did work and that, until further notice, they are not stuck in a quagmire. On the other hand, though Obama had vowed not to get involved in a new Middle Eastern war, there are reportedly some 4,000-6,000 U.S. troops deployed in Syria and Iraq to fight the Islamic State, a number that may well rise in the coming years, given the new focus on containing Iran.

It’s convenient to say that the decline of American power in the Middle East was a consequence of the U.S. invasion of Iraq in 2003. Certainly, that intervention upended decades of American partiality to the status quo in the region, but president George W. Bush’s decision to stick it out in Iraq suggested, even in the minds of his severest Arab critics, that the United States was not planning for regional retrenchment, despite its grave initial setbacks. To an extent that was reassuring to the Arab regimes.

Obama was very different. He was so convinced that the Middle East had eaten up too much of America’s time since the September 11, 2001, attacks, that he grandly announced he would pivot away from the region, towards Asia. If only regions understood their place in America’s timetable, the then president appeared to be saying, we would all be better off. The Arab world didn’t, however, and in 2011 the region went through a potentially revolutionary upheaval with which Obama never engaged imaginatively, because he was so persuaded it was a burden on his attention.

In the aftermath, the U.S. began to slowly see the erosion of its major regional alliances. President Hosni Mubarak was dropped in favor of his democratic opposition, a move that angered many of Washington’s regional allies. Obama refused to do anything in Syria, even after the Ghouta chemical attack of August 2013, and in the process alienated not only Saudi Arabia, but also Turkey, both of which subsequently fell back on looking the other way as more radical groups emerged to fight Assad.

In other words, Obama learned to his detriment that the United States could do a great deal of damage simply by doing nothing. This was later compounded by the administration’s eagerness to conclude a nuclear deal with Iran that shaped its outlook in Syria, and that implicitly justified ceding a stake in the country to Iran. After all, it was the president who told Jeffrey Goldberg of The Atlantic about the need for Saudi Arabia and Iran to “share the neighborhood.” Presumably, Obama meant that under such an arrangement Iran would retain sway over Syria, making his earlier remarks about a Russian and Iranian “quagmire” there all the more puzzling.

To the detriment of the Syrian population, both Moscow and Tehran showed a far better grasp of the essence of power than the purported “realist” Barack Obama, and a far clearer sense of a plausible Syrian endgame than Washington. Today, the Russians are reportedly favorable to a federal structure in Syria, similar to the Russian Federation, and are said to have discussed this recently in a meeting held in Moscow with Siphan Hemo, the head of the Kurdish People’s Protection Units. The Syrian regime opposes federalism, as does the Syrian opposition, but Russia realizes that with the Syrian Kurds holding an estimated third of Syria’s territory, such an outcome may be inevitable, or a discussion of it at least.

What this underlines is that the Russians entered Syria with a most basic understanding that their military should be used to impose a political solution beneficial to Moscow and that would preserve their Syrian ally. Such a solution may or may not work, but for now the Russians have put in place a process in Astana that can facilitate it by bringing together two of the major regional actors, Turkey and Iran, with a stake in what happens in the country. Its cynicism notwithstanding, Russia has made real progress.

The United States, in turn, has avoided seriously pursuing any political result beyond its aim of fighting and defeating the Islamic State. This startling short-sightedness—because politics will define whether groups similar to the Islamic State reappear in the future—is associated as much with Obama as with the administration of Donald Trump. Last July there were reports that U.S. Secretary of State Rex Tillerson had told United Nations Secretary General Antonio Gutteres that Assad’s fate “now lies in the hands of Russia.” In other words the Americans never really had a political strategy of their own in the country, beyond backing the UN’s Geneva framework, whose effective failure made them turn to the Russians.

Clarity of purpose has brought Russia dividends in the region, while America’s ambiguous, narrow approach has led to a worsening of ties with Turkey and uncertainty in the U.S.-Saudi relationship. Even Assad’s enemies have seen advantages in dealing with Russia, as the recent visit to Moscow of King Salman of Saudi Arabia showed, though Syria was just one item in a broader agenda of discussions. Russia, despite its support for the Assad regime and its killing of large numbers of civilians, has been viewed as knowing what it wants, a quality even its enemies can appreciate.

So, two years after Obama confidently warned Russia that it was entering the Syrian quicksand, Moscow has used its successes in Syria to leverage its return to the Middle East. Assad’s enemies have no reason to rejoice, but Obama never cared about them. Instead, the former president has learned the dangers of hubris when his performance justified only modesty.