The military coup in Turkey last weekend started on Friday and consisted of attempts to take over government buildings and key infrastructure. The coup drew mostly on troops from the gendarmerie and the air force and was led by mid-level generals and colonels. There were some initial successes but by early Saturday morning it was clear that the government had prevailed. By Sunday nearly 6,000 arrests of alleged plotters had taken place with more certain to follow.

President Recep Tayyip Erdogan has vowed a crackdown on the military and also the judiciary and has blamed the coup on arch foe Fethullah Gulen, who resides in exile in Pennsylvania. Analysts believe that defeating the coup has greatly increased Erdogan’s authority and he will be able to consolidate his power by altering the country’s constitution, which, given the sense of crisis in Turkey due to the coup and the recent terrorist attack in Istanbul, is likely to succeed. And due process for the alleged coup plotters under the present circumstances is likely to be limited. They reportedly will be charged with treason. Erdogan will be able to clean house and consolidate his power.

There is inevitably a counter narrative which I and a number of Turkey-watchers who have networked to discuss recent developments are inclined to believe. As full disclosure, I will admit that all of us are established critics of the autocratic and Islamist direction being pursued by Erdogan’s government over the past three years.

First of all, though it is not a major issue, none of us believes that Gulen was behind the coup. It is convenient for Erdogan to blame his principal opponent because it will facilitate the arrests of any and all opponents not linked to the actual coup by claiming that they are Gulenists. Erdogan has become adept at jailing opponents, often journalists, on trumped up charges to include treason and this time around will be no different. The process has already begun with the detention of a number of military officers and judges and will no doubt be expanded as more enemies are identified.

Second, nearly all of us believe that the coup was basically a set-up. Erdogan and his government have been warning for months about the possibility of a coup, so the event itself should surprise no one. It is now certain that there was a coup in fact being plotted, apparently supported mostly by Kemalists in the military who advocate a secular state and are alarmed by aspects of Erdogan’s foreign policy, including his collaboration with terrorist groups and hostility towards Russia and Syria. There was also likely an element of concern over the deteriorating Turkish economy with European fear of terrorism wrecking the tourism industry, an issue linked to Ankara’s meddling in Syria and Erdogan’s personal vendetta against the leading Kurdish political party the Peoples’ Democratic Party (HDP). Many observers and even government officials when speaking off the record have also criticized the Erdogan-driven breakdown in the truce that up until recently prevailed with the domestic Kurdish minority and its armed wing the PKK.

The coup plotters probably erred in their assumption that there was wide support at senior levels in the Turkish military for a coup. The generals, who once would have been natural opponents of Erdogan’s ambitions, had been severely punished in their first encounter with the then prime minister in 2010-11. A series of show trials claiming that the senior officers were involved in plotting against the government based on very flimsy evidence removed many upper ranks, replacing them gradually with Erdogan loyalists. Many of the officers so convicted have only recently been released from prison but, having been out of power for years, they have not retained any ability to take action against the government.

The coup plotters may have approached one or more of the new Erdogan-appointed generals, without whose support a coup could not succeed, expecting a sympathetic hearing. In all likelihood, they were received cordially but the senior officer immediately reported their overture to the president, setting the stage for a trap.

The rest followed course somewhat as planned. The plotters heard from sympathizers in the judiciary or police that they would soon be arrested so they started the coup before their plans were complete and almost caught the government by surprise. They were few in number so they must have hoped that they would be joined by others. They were not successful and loyal army and police units quickly organized to resist them. Erdogan also was able to call on his civilian supporters to take to the streets and gather at the airport in Istanbul. The results were predictable and the coup was crushed. Erdogan will now reap the political benefits. He is also demanding the extradition of Gulen from the United States and the Obama Administration is reported to be considering the request.

One other aspect of the coup has caused some confusion. Early on it was alleged without any evidence that the plotters were dismayed by recent Erdogan government overtures to Russia and Syria to restore normal relations. That is a complete misreading of developments, as the Turkish military has long been reluctant to support any operations in Syria and, in general, is opposed to any initiatives outside Turkey’s borders. During a brief takeover of Turkish television the coup leaders referred to their movement as a “peace council.” The generals have their hands full with the internal Kurdish and refugee problems and are most definitely not encouraging taking on anything new.

One might also add to changes vis-à-vis Russia and Syria the recent rapprochement with Israel. Turkey’s economy is in bad shape and its international standing has been gravely damaged by Erdogan’s foreign and domestic policies. Opinion polls have been suggesting that the Turkish public is blaming Erdogan directly for the decline in employment and income as well as for the terrorism problem. The shift in policy to mend fences with a number of countries has been a response to that concern and is unrelated to the discontent within the Turkish military.

So the aborted military coup has become a great victory for President Erdogan. It remains to be seen how exactly he will exploit it, but it is certain that he will use it as a pretext for expanding his own powers. To those who object to the notion that the Turkish president would kill his own soldiers to advance his political agenda, one might note that he was considering doing so in 2014 to create a pretext for war with Syria. Consequently the question whether Erdogan might actually have helped set up the coup in a version of a false flag operation is certainly intriguing and must be considered. It should be taken into account by the White House before contemplating bending to any demands from Ankara to extradite Gulen or any of his associates.

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