The Republic of Turkey has become a loose cannon on deck, a short-term asset in enabling the U.S.’s bombing of northern Syria but a major liability when it comes to any eventual settlement intended to quell the fighting in the region.

President Recep Tayyip Erdogan is seeking to destroy both genuine enemies and far less blameworthy critics alike in his over-the-top reaction to July’s attempted military coup. His emergency powers were recently extended. He has used an enemies list, prepared pre-coup, to detain 37,000 without any prospect of trial, to arrest or fire more than 100,000 government officials, to shut down newspapers and televisions stations, to close schools and universities, and to wage an increasingly bloody war against the country’s minority Kurds. In Kurdish southwestern Turkey there have been wholesale dismissals and even arrests of teachers, bureaucrats, and elected officials, including mayors. They are being replaced by appointees from Ankara loyal to the government but frequently lacking in the training required to do their jobs.

Erdogan’s paranoia and desire for revenge run deep. Alleged coup organizer Fetullah Gulen has been described as the head of a “terrorist organization … intent on subduing the entire world, far beyond Turkey.” Turkish embassies and consulates overseas have been ordered to compile lists of disloyal citizens, and Ankara even sued a German comedian who satirized Erdogan. In Turkey itself, police and intelligence agents have been arresting people who possess multiple American $1 bills whose serial numbers all start with the same letter. (It is believed that the banknotes were used to establish bona fides among coup plotters.) Reading the wrong newspaper or book has led to firing or imprisonment, while parliamentary critics are being silenced and threatened with arrest after being labeled as terrorists. There have been frequent reports of torture, beatings, and even rape of those detained, and Erdogan has supported calls for the death penalty for military officers involved in the coup.

And then there is the ongoing corruption of Erdogan himself, his family, and his close associates. Turkey illegally bought Iranian oil while Iran was under sanctions, and Erdogan’s son Bilal used his tankers to move it to markets in East Asia to sell it. Fearing a police raid at one point, Erdogan telephoned his son and advised him to go to his safe, remove all the money inside, and hide it. Now the government has been arresting businessmen accused of being sympathetic to the coup without presenting any evidence, while also confiscating billions of dollars in assets belonging to their companies. The assets are being “temporarily” managed by political associates of Erdogan.

Erdogan is unfortunately supported by a solid bloc of voters who see the world the same way he does and generally share his intense and often-cited religiosity. He is inspired by his own personal sense of righteousness, and he has exhibited what one might reasonably describe as megalomania, seeing grandiose building projects and a redefinition of Turkey’s domestic and international interests as part and parcel of his own authority and that of his ruling AKP party.

I have previously described how Erdogan’s increasingly aggressive foreign policy has long been driven by a somewhat legitimate fear of the development of an independent Kurdish state, which presumably would incorporate parts of Turkey with northern Syria and Iraq as well as western Iran. Indeed, Erdogan’s recent participation in the fighting against ISIS is actually a deliberate misdirection, being instead mostly aimed at striking the Kurdish militias that the United States regards as its most effective fighting force against the terrorist groups.

More disturbing still, recent developments suggest that Ankara is now entertaining irredentist claims over former parts of the Ottoman Empire that are adjacent to Turkey’s current borders, including Mosul in Iraq, areas just north of Aleppo in Syria, and parts of Greece. Erdogan has argued that he has a responsibility to protect “Turks” in neighboring states, a rationalization that he has been employing to bomb Kurdish-controlled areas and to demand a role in the impending Iraqi assault on Mosul, which has a small Turkmen minority. Iraq’s government, knowing that once Ankara has its foot in the door it will be difficult to make Turkish soldiers go home, has flatly rejected the offer. Erdogan responded by observing that Turkey has a right to invade Iraq if it feels threatened.

The aim to assert some form of regional dominance is a reversal of Turkey’s former foreign policy, which stressed friendly relations with all its neighbors. One might further suggest that the July coup let the genie out of the bottle, fully liberating Erdogan from whatever restraints he believed himself to be under and giving him an opportunity to rewrite the country’s constitution to enhance and perpetuate his own power, a process that is now well underway.

Many reasonably question whether NATO should exist at all after the demise of the Soviet Union, but including Turkey as a member raises some very serious concerns due to Article 5 of the Washington Treaty (which created the alliance). This provision requires all members to respond to a military threat against any member state as a “collective defense.” As the alliance purports to be defensive in nature, Turkey’s irredentist claims are problematic—particularly as it would not be particularly difficult to contrive an incident that would make an offensive operation appear to be self-defense. Such an incident took place in December 2015 with the clearly premeditated downing of a Russian warplane that had strayed over the border into Turkey for 17 seconds. Turkey regarded the incursion as an act of war. Fortunately, Moscow was restrained in its response, and the situation did not escalate in military terms, so the issue of NATO involvement, though it briefly surfaced in Brussels, was essentially moot.

In addition, as a basically European-American alliance, NATO has long taken as a given that member states will conform to reasonably democratic norms. That is something that Turkey is rapidly moving away from with its mass arrests, show trials, and collective punishments while Erdogan seeks to aggrandize his position by enhancing his own presidential powers. As Doug Bandow of the Cato Institute puts it, “Turkey’s brief democratic moment is ending.”

For the United States, the calculus is somewhat complicated. Hillary Clinton will likely up the ante in Syria, which will require the use of the airbase at Incirlik. But after that, presuming that World War III can somehow be averted while the escalation and intervention are taking place, the role of Turkey should be reevaluated based on strategic considerations distinct from the current fighting in Iraq and Syria. Ankara’s status as a long-term strategic asset should certainly be challenged, particularly in light of the Erdogan government’s authoritarian predilections.

Most observers in Washington now believe that ISIS will soon be defeated as a territorial threat, though it likely will retain a base of operations in troubled Libya. That means any continued operations against the group will be conducted by special ops and intelligence personnel, and thus will not require extensive infrastructure and support. As the U.S. will retain major regional military assets in Kuwait, Bahrain, and Qatar, Turkey will become a backwater and a Cold War relic, redundant, with Washington instead increasingly focused on security issues surrounding Iran and the Sunni-Shia conflict.

Ankara persists in believing that its current strategic importance means that it can do or say anything and Washington will avoid any criticism, but the White House is clearly beginning to recognize that Turkey is, in the long run, a liability as long as Erdogan’s brand of democratic centralism prevails. And it must be observed that the current bilateral relationship, in which the administration leans over backwards to placate an invariably irritable Erdogan, produces bad policy. In the recent contretemps with Baghdad over an enhanced Turkish role in Mosul, Secretary of State John Kerry unwisely urged the Iraqis to let the Turks become a partner in the enterprise. He was tone deaf to other considerations of which the government in Baghdad and America’s Kurdish partners were all too aware.

The White House should recognize that Turkey has become a destabilizing force in the Near East. Its past collusion with—and arming of—terrorist groups like ISIS reveals that it is not unwilling to play a double game against its nominal allies. Its implacable hostility toward all things Kurdish affects the internal stability of nearly all of its neighbors and even diminishes Washington’s ability to deal with ISIS. Its increasingly assertive nationalism, which is beginning to define itself as irredentism—backed by what is still, after the purge of thousands of personnel, the most powerful military in the region—could easily morph into a series of local conflicts as Ankara seeks to realign its borders.

If Turkey continues to remain in NATO, and if the U.S. persists in being closely tied to it logistically, the eventual consequences could be grave, with Washington again drawn into a Middle East quagmire by virtue of a war that it is neither prepared for nor seeking to fight.

Philip Giraldi, a former CIA officer, is executive director of the Council for the National Interest.