Recep Tayyip Erdogan could soon become the most powerful Turkish leader since Mustafa Kemal Ataturk, who founded modern Turkey, and arguably the most powerful leader “since the collapse of the Ottoman Empire” in 1923, Soner Cagaptay told me.

Cagaptay told me this on Sunday, just two days after roaring fighter jets, rolling tanks, and rebel helicopters had descended on Ankara, Istanbul, and the Turkish Riviera in an attempt to overthrow the Turkish president—two days after the insurrectionists had forced a television newscaster to read their manifesto on air, while Erdogan was reduced to FaceTiming with a TV anchor from an undisclosed location, flickering in and out of view as the anchor received incoming calls. How, between Friday and Sunday, had the itty-bitty man on the iPhone screen morphed into the second coming of Ataturk? Why did FaceTime triumph over tanks? And what does that tell us about the nature of Erdogan’s power, and how he might wield it after squashing last weekend’s coup?

Cagaptay, an expert on Turkey at the Washington Institute, has been warning for months of Turkey’s coming crackup. In a 2015 article for The Atlantic, he noted that Erdogan’s policies and power grabs in recent years had produced a toxic mix of political polarization, widespread opposition from the minority Kurdish population, and blowback from the Syrian Civil War, including attacks by ISIS and Kurdish militants. It was up to Erdogan, he wrote, to “tamp down tensions before they explode.”

As the coup and its aftermath come into greater focus this week—with Erdogan’s reinstated government rounding up tens of thousands of security forces, judges, teachers, politicians, and other officials, and demanding the U.S. extradite Fethullah Gulen, an exiled Turkish cleric in Pennsylvania, for allegedly plotting the putsch—I asked Cagaptay why the explosion he feared had played out the way it did, and what might come next for Turkey.

The revolt against Erdogan failed in part because of basic math, said Cagaptay. Unlike past successful coups in the country, this one was not orchestrated by top military officials through the chain of command; instead, a faction of the security services, perhaps concentrated in branches like the Air Force and gendarmerie, appears to have been implicated. Erdogan retained control over much of the military and police force throughout the showdown. “There were probably more pro-Erdogan people with weapons than pro-coup people with weapons in the end,” Cagaptay noted. The rogue soldiers also squandered whatever public support they might have mustered by bombarding cities and firing on their own people.

But maybe more importantly, the coup failed because Erdogan won the information battle on two fronts. The putschists staged a “1980s-style” coup, Cagaptay told me, proclaiming their takeover on the public broadcaster TRT, which isn’t widely watched in Turkey these days. “Erdogan goes on his smartphone, does a FaceTime interview, puts it on social media, millions saw it,” Cagaptay said. “It was a victory of digital over analog, in terms of communications styles.” (Turkish cellphone-service providers reportedly ramped up call, text, and data packages during the tumult.)

What proved pivotal was not just the medium, but the message: In the interview, in Facebook and Twitter posts, in a text message sent to every cell phone in the country, Erdogan called for his supporters to take to the streets in defense of his democratically elected government. And they did, en masse, in the wee hours of Saturday. “That is the turning point of the coup,” Cagaptay argued. “That’s when the countercoup started to rise.”

Around the same time, according to Cagaptay, Erdogan urged imams to mobilize people as well, likely through communications channels maintained by the government’s religious-affairs directorate, which runs and funds Turkey’s 80,000 mosques. Mosque loudspeakers began issuing the call to prayer at an ungodly hour. “It would be the equivalent of church bells suddenly starting to toll all over the United States at 1:15 AM, and ringing for hours,” Cagaptay said. Erdogan was asking his political base, which includes many Islamists, to “flood the country.” The Wall Street Journal reports that Mehmet Gormez, the head of the religious directorate, “ordered thousands of imams to recite prayers known as ‘sela,’ ordinarily reserved for funerals and special religious occasions. When issued at other times, the prayers act as a call to arms for the Islamic community.” Within hours, people were clambering on top of tanks. The coup was a husk of its former self.

Erdogan “likely owes his survival to a counteroffensive that marshaled military might, technology and religion,” the Journal notes. “It was the first time in Turkey’s history that its citizens rose up to prevent a military coup.”

Critically, however, the evidence so far suggests that Erdogan won’t be leveraging this popular support—which included backing from many of his secular, liberal opponents, who were aghast at the military’s subversion of Turkish democracy—into a campaign to bridge the country’s political divisions. He won’t be scaling back his crackdown on the press, social media, and freedom of expression and assembly, even if he now largely owes his survival to those fixtures of a free society.

Instead, he has embarked on a purge whose vast scale and scope belies the notion that he’s simply rooting out those who were involved in the coup. You don’t expel tens of thousands of people from the government in a matter of days unless you’ve been keeping tabs for some time on rivals to stamp out and scores to settle.

Cagaptay envisions two scenarios for how Erdogan could proceed. One is drastic and dramatic. The conservative, Islamist-allied Erdogan has already challenged Turkey’s tradition of secularism—a tradition the military has long sought to uphold—in realms such as public education. Now Erdogan could harness the religious zeal whipped up by the coup to disregard the Turkish constitution and usher in an Islamist revolution. The current climate “reminds me at times of Iran in 1979 [during the Islamic Revolution] when I see the fervor on the streets and the constant call to political activism through the mosques, the mixing of religion and politics,” Cagaptay told me. He admits that Erdogan is highly unlikely to pursue this course. And yet, the “Iran 1979 scenario has never been closer to reality than today.”

The more likely scenario is that Erdogan capitalizes on his post-coup support to push constitutional amendments through parliament that change Turkey from a parliamentary system to a presidential one, with Erdogan at the helm. (Erdogan became president in 2014 after serving the limit of three terms as prime minister, though he has remained Turkey’s de facto leader even when occupying the ostensibly ceremonial presidential office.) This approach would be in keeping with Erdogan’s “pragmatic, gradualist” style, Cagaptay said. Erdogan has already amassed a great deal of power, Cagaptay noted, but he’s done so over 13 years, unlike Mohamed Morsi, the Islamist leader and former Egyptian president, who tried to consolidate authority all at once and was overthrown in a military coup as a result.

The Democracy Report

Before the coup, many analysts “thought that if Erdogan went too far, the military could always step in to check him,” Cagaptay said. But “Erdogan now has a carte blanche to go as far as he wants. All this time we wondered what Erdogan’s final agenda [for] Turkey was. We are now going to see it.”   

Erdogan, Cagaptay continued, “has a track record of persecuting and prosecuting his opponents, usually on the premise that there’s a conspiracy to undermine him.” Now it’s clear that there actually “was a conspiracy to undermine him. ... So I think his crackdown on dissent is going to become more pervasive, the net is going to be cast more widely. As he marches toward an executive-style presidency, it will become even more difficult for people in the opposition to oppose him democratically, because every opposition movement can easily be labeled as supporting a coup, therefore being illegitimate, and therefore susceptible to being targeted by the government or by its supporters.”  

One of the greatest casualties of the coup is the Turkish military, Cagaptay added. Erdogan has been trying to neutralize the military for years, in part through a series of dubious trials and convictions over an alleged coup plot. On Friday, according to Cagaptay, the “military made one more effort to stand up to Erdogan. And it lost.” Not only did it lose, but in the process it flung itself into Turkey’s partisan muck: The failed insurrection “is the final nail in the coffin in this long historical tradition of the Turkish military being the ‘grand arbiter’ of Turkish politics, seeing itself as the protector of Turkey’s constitutional order and secular politics.”

“Until this coup the military was the most respected and trusted public institution of the country,” Cagaptay said. “Now it’s going to witness a free fall of its respectability.”

The coup, and Erdogan’s response to it, could also seriously damage Turkey’s relationships with the EU and U.S., at a time when those relationships are crucial given Turkey’s role in absorbing refugees and battling ISIS. Erdogan’s government is considering reinstating the death penalty to punish coup plotters, which would halt Turkey’s bid to join the European Union. And Erdogan will be gutting the military just when the United States had finally convinced Turkey to contribute an air base and special forces to the fight against ISIS in Syria. After ISIS’s attack on the Istanbul airport in June, “for the first time perhaps, Turkish threat perceptions of ISIS were almost the same as U.S. threat perceptions of ISIS,” Cagaptay explained. The coup may “freeze much of that cooperation.”

All this is hard to stomach for Cagaptay, who just two years ago wrote a book titled, The Rise of Turkey: The Twenty-First Century’s First Muslim Power. Erdogan, he noted, has improved living standards in Turkey and fashioned Turkey into a middle-income country. But he never healed Turkish society’s most problematic schisms—between religious and secular Turks, between the government and the Kurds. In fact, those schisms have only grown more pronounced. Erdogan, Cagaptay told me, “is going to go down in history as the guy who transformed Turkey economically, and either messed it up politically or almost messed it up politically.”