Within the country, the military saw Gülenists as a considerable threat. Gareth Jenkins, a fellow at the Central Asia-Caucasus Institute in Istanbul, said that, during the nineteen-nineties, the armed forces expelled hundreds of officers on suspicion of harboring links to Gülen. In a cable released by WikiLeaks, an American diplomat wrote that secular officers devised a test: they invited fellow-soldiers and their wives to pool parties, reasoning that women who declined to appear in public wearing swimsuits must be restricted by their religion. According to the diplomat, the Gülenist wives became aware of the tactic and came up with a countermeasure: they started wearing bikinis more revealing than their hosts’. When military inspectors began searching officers’ homes, the Gülenists stocked their refrigerators with decoy bottles of alcohol and planted empties in the trash.

Hanefi Avcı, the police chief for Eskişehir Province, told me that he saw Gülenist police, prosecutors, and judges fabricate evidence in political investigations. But when he alerted his superiors he was ignored. “I talked to ministers and I wrote memos and didn’t get any replies,” he said.In 2009, Avcı secretly began writing a book detailing the Gülenists’ activities in the police and judiciary. He described a movement of protean adaptability, whose methods resembled those of terrorist groups and criminal organizations; they framed opponents by planting evidence or blackmailed them with information gleaned from wiretaps. “What made the Gülen movement different is that it was inside the state,” he said, noting that infiltrators in his department had sabotaged the careers of at least ten colleagues. The book, called “Simons Living on the Golden Horn” (the title is an abstruse metaphor for not seeing what is in plain sight), became a best-seller. It seemed especially authoritative because Avcı, a conservative Islamist, had two children in Gülenist schools.

The judiciary, emboldened by Ergenekon and Sledgehammer, pursued the investigations ever closer to Erdoğan. In the early months of 2012, police issued a subpoena to Hakan Fidan—the chief of national intelligence and a confidant of the Prime Minister—and arrested Ilker Başbuğ, the country’s highest military officer. “They felt that they could arrest anyone,” Gareth Jenkins said. Erdoğan responded in a way that seemed calculated to hobble the Gülenists: he started closing down their schools—a crucial source of income—and working to restrain the police.

On December 17, 2013, police arrested Zarrab and eighty-eight others, including forty-three government officials. Although they did not arrest any of Erdoğan’s ministers, they detained the sons of three of them, claiming that they were conduits for bribes. Erdoğan’s son Bilal also came under suspicion, after a wiretap captured what was alleged to be a conversation between him and his father. Erdoğan has insisted that the tape was doctored, but it circulated widely on social media, and Turks claimed to recognize his voice.Tayyip Erdoğan: Eighteen people’s homes are being searched right now with this big corruption operation.&nbsp;.&nbsp;.&nbsp;. So I’m saying, whatever you have at home, take it out. O.K.?Bilal: Dad, what could I even have at home? There’s your money in the safe.Tayyip: Yes, that’s what I’m saying.A little while later, the two apparently spoke again.Tayyip: Did you get rid of all of it, or&nbsp;.&nbsp;.&nbsp;. ?Bilal: No, not all of it, Dad. So, there’s something like thirty million euros left that we haven’t been able to liquidate.

On Christmas Day, 2015, Turkish intelligence breached an encrypted messaging app called ByLock—an apparently homemade network with two hundred thousand users. According to Turkish officials, it was set up not long after Erdoğan began purging suspected Gülenists from the government. When the network was discovered, the server, in Lithuania, quickly closed down, and its users switched to Eagle, another encrypted messaging app. “They went underground,” a Turkish government aide told me.The intelligence officials say that they were able to decrypt the exchanges, and one told me, “Every conversation was about the Gülen community.” By checking the ByLock users’ names against government records, they found that at least forty thousand were civil employees, mostly from the judiciary and the police department. In May, two months before the coup, the government began suspending them.In July, the intelligence department notified the military that it had also identified six hundred officers of the Turkish Army, many of them highly ranked, among the ByLock users. Military officials began planning to expel them at a meeting of senior generals that was scheduled for early the next month. “We think the coup happened in July because they needed to move before they were expelled,” Ibrahim Kalın, the Erdoğan aide, told me.

it seems that the plotters staked their operation on capturing or killing Erdoğan and persuading General Akar to join them. “If those things had happened, the coup would have succeeded,” Kalın said. But none of the most senior generals of the Turkish armed forces could be persuaded to join, which may have left the plotters without a military leader. By 4 A.M., the coup plotters were running for their lives.

For Erdoğan, though, retribution has always come more easily than apologies. The state of emergency that he declared after the coup gave him dictatorial powers, which he used to carry out a far-reaching crackdown that began with Gülenists but has grown to encompass almost anyone who might pose a threat to his expanded authority.

Public criticism of Erdoğan has been almost entirely squelched, either by the outpouring of national support that followed the coup or by the fear of being imprisoned. Erdoğan has closed more than a hundred and thirty media outlets and detained at least forty-three journalists, and the purge is still under way.