Turkey borders several Middle Eastern countries that are either unstable or potentially hostile to it, sometimes both simultaneously. With a modern military of more than 600,000 underwritten by NATO membership it is regional superpower whose ability to dominate the politics of its neighbors is sometimes exercised. Turkey has a large and educated population, a vibrant diversified economy and is at the crossroads of east and west, Asia and Europe. Together with Egypt, it is truly the indispensable nation if anyone wants to seriously consider influencing developments in the Near East.

It is perhaps Turkey’s indispensability that is part of the problem, as it has given its current government a hubristic sense of entitlement that has developed into a conceit that it can be the arbiter for all its neighbors while also transforming itself into an autocracy at home. President Recep Tayyip Erdogan is attempting to turn the country’s traditionally fractious party politics into one party rule with himself at the helm. In so doing he has created what some call an “illiberal democracy” where dissent is systematically repressed and elections are rigged to favor his incumbency.

Erdogan has largely destroyed his country’s independent media by imprisoning and intimidating journalists, has not hesitated to characterize protesters as “terrorists” before having them beaten and shot, has packed the military and intelligence services with his own supporters, and has hobbled the judiciary and police. In Turkey it is now a crime to “insult” a public official. The law is strictly enforced regarding Erdogan. A man was fired from his job and is facing two years in prison for comparing the president to Gollum, the character in Lord of the Rings.

As president, Erdogan was not allowed to get involved in parliamentary elections in June and October, but he instead campaigned relentlessly on behalf of his Justice and Development Party (AKP). As the margin in parliament opposing him consisted of a Kurdish Party he unilaterally restarted a civil war with the Kurds and fear-mongered recklessly before calling for a snap election, resulting in AKP’s regaining its parliamentary majority.

Erdogan has taken a largely secular republic and turned it into a state increasingly run on Islamic principles, funding religious schools, introducing religious curricula at universities, converting historic churches into mosques and also building hundreds of unneeded new mosques. He has supported legislation outlawing the drinking of alcohol in public and has instructed stewardesses on the state owned Turkish Airlines not to wear makeup. He has made religiosity a prerequisite for high office. One almost has the sense that there is nothing that he would not dare to do.

Ankara’s recent shoot down of a Russian bomber that might or might not have strayed briefly into Turkish airspace was a very bad mistake as it made clear to all concerned that the Erdogan phenomenon has a very reckless side. Turkey, to its credit, has not tried to argue that the incident was a mistake ordered by a lower level military officer and, given the sensitivity of shooting down a foreign warplane, one has to assume that the decision to do so must have originated at the very top of the government. Media reports suggest that Russian bombing of ethnically Turkish Turkmen insurgents inside Syria had inflamed opinion while the Turkish military was exasperated by repeated Russian violations of its airspace, but the premeditated and deliberate targeting of a Russian plane, which is surely what took place, would have been a high risk low gain option at the best of times. Under normal circumstances, when a plane accidentally enters someone’s airspace, military jets are scrambled to escort the intruder out, but in this case a kill order was obviously in place, a drastic step that could have easily led to a regional war or even worse if Ankara had somehow been able to convince NATO to get involved on its behalf.

Turkey shot down the Russian plane because Moscow was effective in the fight against the Syrian insurgency, to include ISIS, enabling the Syrian army to recover lost territory. As Turkey is nominally a U.S. ally in combatting ISIS going after another de facto ally would seem to be a strange choice, but it ignores the fact that Ankara has been duplicitous from the beginning in terms of its real objectives. Turkey has been reckless in allowing jihadists to travel through it both coming from Europe and returning from the battlefields of Syria. Turkey’s major strategic goals in the Syrian civil war have everything to do with striking the Kurds and removing Bashar al-Assad from power. Erdogan has no interest at all in defeating ISIS, quite the contrary.

Ankara has studiously avoided attacking ISIS because its true objective is to prevent the formation of any Kurdish State, which would in part be on a considerable piece of Turkish territory if it were fully realized. The animus being directed against Syrian President Bashar al Assad is due to the fact that Ankara believes him to be complicit in supporting anti-Turkish Kurdish rebels along the border. That means the Erdogan is using the war against ISIS as a cover for his own agenda, which is bombing the Kurds and eliminating the Syrian government as a potential supporter of dissident Turkish Kurds who might be using Syrian territory as a safe haven.

Indeed, one might reasonably go a step farther to assert that Turkey has been an ally of ISIS, supporting from the beginning radical Sunni groups that eventually came together to form the terrorist organization. When I was last in Istanbul in July 2014, ISIS supporters were seen in various Istanbul neighborhoods collecting money to support their cause. There have since that time been frequent reports of ISIS militants moving back and forth across the Syria-Turkish border without any interference from Ankara. It has been suggested that wounded militants were routinely treated in Turkish hospitals and allowed to recuperate and rearm inside Turkey. There have also been widely observed movements of weapons into Syria to arm ISIS organized by Erdogan’s government. Recently two well-known Turkish journalists were arrested for reporting on the arms movements. They face years in prison if convicted, which will surely be the case.

Turkey is also proving to be an opportunist vis-à-vis its European neighbors. It has been taking advantage of the refugee crisis, which it has helped create, and exploited legitimate fear of ISIS infiltration. Erdogan has promised to slow the human wave engulfing Europe only if the European Union comes up with 3 billion Euros to cover expenses.

The Turkish people wisely are resistant to military engagement outside Turkey’s borders so the government of Erdogan has considered desperate expedients to create a casus belli to justify waging its own particular war against the Kurds on Syrian soil. Back in 2014 it plotted with its intelligence chief Hakan Fidan to stage a false flag attack on the tomb of Turkish Sultan Suleyman Shah, which for historical reasons is located inside Syria and is guarded by Turkish soldiers. It would have meant killing fellow Turks to create an incident that would have justified massive retaliation and direct intervention in Syria.

More recently there have been a number of attacks inside Turkey that have been attributed to ISIS but which just as plausibly might be credited to the Turkish intelligence service MIT. One bombing in Ankara in October, attributed alternatively to ISIS and to Kurds, killed 102 and was particularly suspicious coming as it did shortly before elections. The various attacks were exploited to increase government pressure on the Kurdish minority and to weaken the opposition People’s Democratic Party (HDP), which is largely Kurdish. The so-called ISIS attacks also were used to create the impression to the U.S. and NATO allies that Turkey was actually in the fight against the Islamic State even though it really was not. The White House, frustrated by the Turkish inaction, was not fooled by the charade but it felt that it was in no position to contradict Erdogan.

And then there is the money aspect. Turkey has long been the principal buyer and exporter of the oil ISIS has been extracting from fields in Syria and Iraq, just as it bought Iranian petroleum when that nation was under sanction. The business is the principal source of funding for ISIS and is also an extremely profitable family enterprise for the Erdogan family. The president’s son Bilal is the principal owner of BMZ Group Denizcilik, which has tankers that move the oil to other markets, mostly in Asia but also including Israel, where the provenance of the petroleum is not an issue. A police and judicial investigation into Bilal’s activities initiated in 2013, which also included his brother Burak as well as the sons of many other prominent government officials, was halted when Erdogan intervened to fire or remove the policemen and judges involved, claiming that he was the victim of a “judicial coup.” A phone call from then Prime Minister Erdogan to his son reportedly included advice to remove all the cash from the safe at home and hide it.

Meanwhile Erdogan’s son-in-law Berat Albayrak, perhaps not surprisingly Turkey’s Minister of Energy, presides over both the ISIS exports and the pipeline that illegally ships 600,000 barrels a day of oil from Iraqi Kurdistan to the Turkish port of Ceyhan, where it is loaded on Bilal’s ships. Iraq has complained to the United Nations Security Council about the direct export of the Kurdistan oil, which violates agreements reached in December 2014 for the sale of Iraq’s petroleum. A Turkish parliamentarian Eren Erdem, who has tried to expose the fraud, commented “What a brilliant family business!” Erdem for his pains was denounced by a government newspaper as an “American puppet, Israeli agent, a supporter of the terrorist PKK and the instigator of a coup.”

Turkey under President Recep Tayyip Erdogan, who is now seeking to increase his own considerable de facto powers, has certainly become a danger to all its neighbors but mostly inflicts damage on itself. The Turkish people deserve much better. Conflict with Russia served no national interest unless one considers meddling in Syria to be a sustainable policy objective. Deliberately embroiling NATO in the premeditated shootdown of a military aircraft surely sent shock waves through both Washington and Brussels, even if both tepidly endorsed Turkey’s alleged manifestation of self-defense. Erdogan has become, internationally speaking, the proverbial loose cannon on deck. No one knows which way he will roll, but everyone has become absolutely certain that the results will be very, very damaging.