Simon A. Waldman is co-author of the forthcoming The New Turkey and its Discontents and a lecturer in Middle Eastern Studies at King's College London.
The attempted military coup in Turkey ended in total failure. Within 24 hours, the AKP government and President Recep Tayyip Erdogan regained control. Within hours it initiated a purge against the organizers.
But the government's crackdown was not limited to the ranks of the military, a faction of which were the instigators of the coup.
It was extended to the judiciary, schools, universities, the police and intelligence agencies and government workers. Thousands of people have either been arrested or removed from their posts. Prosecutions, further arrests and detentions are inevitable, especially after the government announced a state of emergency giving it further powers to arrest and detain those it suspects.
But why has the purge been so extensive? The Turkish government suspects that the coup was orchestrated by the Gulen movement, followers of Fethullah Gulen, an influential Islamic preacher in self-imposed exile in Pennsylvania. They are believed to be present in many institutions of state.
Mr. Gulen is one of Turkey's most influential and controversial Islamic scholars. The network that follows him classifies itself as a community, the "Hizmet" (the Service), seeking to be a modern and moderate face of Islam and opposed to extremism.
However, the Gulen movement has also been accused of having a secret agenda to infiltrate the state and to Islamize Turkey. This would be achieved by members embedding themselves within state institutions such as the education system, the judiciary, the police force, the state bureaucracy and the military. In other words, it is believed that the Gulen movement established, in the parlance of Mr. Erdogan and the AKP, a "parallel structure" within the state.
When the AKP came to power in 2002, it found common cause with the Gulen movement.
Both the AKP and the "Hizmet" had a common goal; they both feared the military, which at the time was still Turkey's bastion of secularism. Prone to interventions (1960, 1971, 1980 and 1997), the military was suspicious of both the AKP and the followers of Mr. Gulen. Together they took action.
It is widely believed that Gulen sympathizers were responsible for the Ergenekon and Balyoz cases from 2008 onwards, in which hundreds of military personnel were arrested, tried and convicted for planning coups against the AKP (all of the convictions were either overturned or nullified by 2016).
Now, with the military seemingly out of the frame, the AKP, with the support of the Gulen movement, was able to dominate the Turkish political landscape without having to fear a military intervention. However, soon the AKP and the Gulen movement had a major falling out that would wreak havoc in Turkey.
In 2010, Mr. Gulen criticized the Turkish flotilla that was sent to try to break the Israeli blockade of Gaza that left nine Turks dead after Israeli commandos boarded the vessel. This angered Mr. Erdogan, who had made a point of criticizing Israel over its policies in Gaza.
Meanwhile, the Gulen movement disapproved of Mr. Erdogan's so-called Kurdish Opening and behind-the-scene-talks between the outlawed Kurdistan Workers Party (PKK), a central plank of the AKP's platform. Mr. Gulen was also fiercely critical of the government's handling of the Gezi Park protests of 2013, which left several Turks dead after attempting to resist a government-backed plan to replace a centrally located park with a shopping mall.
Soon this dispute turned into all-out conflict after Mr. Erdogan blamed the Gulen movement of leaking tapes to the press and social media in December, 2013, which alleged widespread corruption in government circles that included cabinet members and even Mr. Erdogan himself.
Mr. Erdogan's response was swift and led a full front assault against the Gulen movement with the closing of schools and media outlets associated with the movement as well as purges and reshuffles within the police force and judiciary to marginalize Mr. Gulen's followers.
It is in this context, if the government is to be believed, that the recent coup attempt took place by Gulenist sympathizers within the military.
This was the final straw for the government. They will use this opportunity to, in Mr. Erdogan's words, "cleanse" not only the military from Gulenist influence but also all institutions of state, no less the judiciary and education system.
However, the extent of the crackdown so far has been shocking. The concern is that the government has not limited itself to ousting known conspirators but also mere suspects, considered guilty before proven innocent, or those who simply hold opposing political views. In other words, the Gulen movement has become an excuse for Mr. Erdogan to consolidate further power.