In the millennia-long “tragedy of great power politics” we encounter a recurring phenomenon.  An ambitious leader comes to power, successfully pursues an expansionist policy for a few years, succumbs to hubris, starts making risky decisions, and finally pays the price of not balancing his state’s strategic ends and means.  Classic examples are provided by Cleon before and after 425 b.c., Napoleon before and after 1812, and Hitler before and after 1941.

President Recep Tayyip Erdogan of Turkey, the leader of a medium-sized regional power, follows a similar pattern.  He is able to impact the course of the Syrian crisis, and has been doing so to the detriment of both great powers involved in that crisis—the United States and Russia—whose ultimate interests in the Middle East are closer than they appear.  In pursuit of his agenda he is now acting with reckless abandon.  He needs to be restrained before he does more damage.

Between November 2002—when his Islamist party, the AKP, won its first landslide—and the middle of his second term as prime minister, Erdogan had followed a successful “neo-Ottoman” strategy.  He expanded Turkey’s regional influence while gradually dismantling the legacy of Kemalism at home.  Then came a series of rash moves, starting with the Gaza Flotilla in May 2010, which eventually turned Turkey’s geostrategic position precarious.

In August 2011 Erdogan abruptly announced that Turkey would support efforts to bring down the government of Bashar al-Assad.  This remains his prime objective in Syria regardless of the shifting military and political realities.  Former senior Turkish diplomat Temel Iskit complained recently that Ankara “insisted on maintaining its original mistake even after everyone else woke up to the reality of what was going on in that country.”  The same could be said of Erdogan’s policy vis-à-vis Egypt.  In 2012 he ostentatiously supported Mohamed Morsi’s Muslim Brotherhood regime.  When Gen. Abdel Fattah el-Sisi took power in August 2013, Turkey took the extraordinary step of asking the U.N. Security Council to impose sanctions on Cairo.  In 2014 Erdogan made the rift permanent by calling Sisi an “illegitimate tyrant.”

Over the past year Erdogan’s actions have become erratic.  In May 2015 Turkey helped unleash a massive migrant wave on Europe; six months later Erdogan promised to halt it if the European Union gave Turkey exorbitant sums of money.  In July he ended a ceasefire agreement with the Kurds in eastern Turkey and rekindled a war that has claimed 40,000 lives over the years.  In November Turkey shot down a Russian plane over Syria and swiftly tried to bring NATO into the dispute.

Erdogan’s schemes have had particularly malignant consequences in Syria.  While the Syrian-Kurdish militia desperately defended the city of Kobani against the Islamic State in December 2014, Turkish tanks and guns remained inactive across the border two miles away.  They went into action in February, shelling Kurdish positions in northern Syria.  Far from fighting the Islamic State, Turkey has allowed thousands of foreign jihadists to cross her territory and enter the caliphate-controlled areas.  Ankara has helped al-Baghdadi stay solvent by shipping oil into Turkey, with Erdogan’s son Bilal profiting from its sale on the spot market.  As my friend Doug Bandow wrote in Forbes last November, “there is evidence of more direct assistance—providing equipment, passports, training, medical care, and perhaps more to Islamist radicals.”  According to former U.S. ambassador to Turkey Francis Ricciardone, Erdogan’s government has also provided direct support to al-Nusra Front, Al Qaeda’s Syrian affiliate.

The end result is Ankara’s increasing isolation.  “The assumption was that Turkey was the principal player who could rearrange things and change the established order in the region according to its will,” says Turkey’s former ambassador to the E.U. Uluç Özülker.  “But realpolitik and Turkey’s geopolitical place was never conducive to achieving this.”  Erdogan disagrees.  In February he upped the ante by threatening to send his army into Syria.  The intended target was not the Islamic State: He angrily called on the United States to choose between Turkey and Kurdish “terrorists in Kobani.”  His prime minister, Ahmet Davutoglu, demanded unconditional U.S. support for Turkey’s position.

It would be in the American interest to tell Messrs. Erdogan and Davutoglu that, forced into making such choice, the United States would support the side that has proved its mettle in fighting the Islamic State.  They should also be told that their duplicity and audacity will no longer be tolerated.  The time has come for the Obama administration to give up on the illusion that Turkey is America’s ally.  It should also consider the option of terminating the NATO-based U.S. defense guarantee to a country that has become a rogue state ruled by an unhinged autocrat.