What is worse than an ever-more-authoritarian regime that constantly aims to crush a robust civil society? The answer emerged bluntly in Turkey on Friday night: to have your army pointing its guns at you. To have your army bombing the parliament building. To have a military takeover.

Turkey has experienced its share of coups d’etat since the 1960s, and the nation knows very well the atrocities that follow such an intervention, and the damage it causes to democratic structure. But we have never seen anything like this past week’s coup attempt: It did not bear any of the hallmarks of previous military attempts to seize power.

There is a saying in Turkey: “to wake up to the noise of an army tank,” referring to a midnight military takeover. This latest attempt, though, began on a Friday during rush hour, with jets flying low in Ankara and gendarmerie closing down the Bosporus Bridge in Istanbul. It did not seem to be planned thoroughly from the start, as communication continued to flow through social media and broadcast television.

President Recep Tayyip Erdogan made several appearances on TV and called the nation to take to the street to defend democracy — however ironic that was, in light of his tendencies toward authoritarian rule. The condemnation of the coup attempt was unanimous in the public; main opposition parties gathered at the parliament to show solidarity against the putsch. One prominent public intellectual, Murat Belge, who had backed Erdogan’s party initially but became a critic after the president’s shift toward palpable authoritarianism, wrote, “Even though I do not agree with the AKP supporters on the streets on many topics in life, what they did was a very important and positive action.” Journalist Hasan Cemal, a fervent opponent of Erdogan’s illiberal policies, underlined his years-old slogan, “Soldier! Take your hands off the politics,” a day after the coup attempt.

The coup attempt, and the resistance to it, played out using modern technology. The perpetrators formed a Whatsapp group called “Peace At Home” (they also called themselves the “Peace At Home Council”) and managed the coup through messages, according to Turkey’s state-run news outlet Anadolu Agency. On the other side, government officials used SMS messages and social media to call people out to the street to resist the military. Erdogan and former president Abdullah Gul and spoke on live TV through FaceTime. All that played a crucial role in putting the coup down.

To see Erdogan and the AKP using social media to rally Turks to protect democracy was bitterly ironic. Blocking and/or slowing down the Internet and imposing a broadcast ban on TV are the main methods Erdogan’s administration has come to use during major news events. That was what the government did, for example, after a mine explosion in Soma in 2014 and attacks by the Islamic State last year in Suruc and Ankara, and earlier this summer in Istanbul. The Dogan Media news outlets, whose live broadcast Erdogan joined via FaceTime, have been blacklisted by the AKP, and its executives and journalists have been called “traitors” countless times and persecuted through various methods including ad revenue cuts, smear campaigns and tax fines.

Erdogan and senior Turkish government officials blamed the coup on the Gulen movement — an Islamic network whose leader, Fethullah Gulen, has been in exile in Pennsylvania since 1999 and has feuded with Erdogan since 2014, when prosecutors close to Gulen attempted to arrest Hakan Fidan, the head of the national intelligence agency, because of his involvement in a secret negotiation with the outlawed PKK. Both the president and the exiled cleric had risen from different ideologies of Islam, but they had united in 2007 in an alliance against Kemalist elites, especially in the military. A series of sham trials known as Ergenekon and Balyoz (Sledgehammer) followed, purging the military of many adherents of Kemalism, the secular ideology espoused by Mustafa Kemal Ataturk, the founder of the modern Turkish republic. But once the military was weakened, and ceased to be an obstacle for Erdogan’s regime, a power struggle between the Gulen movement and the AKP followed.

Erdogan ordered detention of disciples of Gulen in the media, police force, judiciary and private sector. Allegedly, the spree of arrests that targeted judges and military officers after the coup attempt was planned long before. Seen in that light, the failed coup, which looked like a kamikaze attack rather than a thoroughly planned military takeover, may instead have been an attempt to head off those arrests in a preemptive strike. One of the alleged masterminds of the coup, Gen. Akın Öztürk of the air force, was appointed by the AKP after his predecessor had been sacked during the Sledgehammer trial.

So the coup attempt bears lessons for everyone who overlooked the importance of a robust civil society, separation of powers and freedom of expression. It also shows that the draconian state the AKP had built is actually very fragile. Erdogan’s government didn’t replace the previous elite with sound constitutional changes and democratic reforms; it only transferred power from Kemalists to their own followers.

Once his loyalists were back in control of the country this weekend, Erdogan called the coup attempt an opportunity sent from God to cleanse the state of the Gulenists, and said that July 15 should be celebrated as the triumph of democracy. But it would be naïve to expect that any democracy would come out of this appalling incident in the short term. Everything Erdogan has done up to now, and everything he has done in the days after the coup — 6,000 people have been arrested since Friday — shows that he would prefer to maximize his power rather than promote democracy. And it is uncertain which way this obvious rift in the military will evolve. It is too soon to claim that soldiers will never again try to take power after Friday night; everyone believed until last week that Erdogan had rendered a coup impossible, and yet, the attempt was made anyway.

Finally, the lingering tension in the country has alarming traits. Unnervingly, the mosques and Erdogan himself are making unending calls to stay on the streets to “protect democracy,” and certain Islamic groups are going to districts mostly inhabited by Alawites, a minority Muslim group, shouting slogans. The same Islamist wave may well start targeting all other segments of the society that it considers infidels, emboldened by the defeat of the coup attempt. Unfortunately, just like coups d’etat, Turkey has been the scene of many pogroms in the past, such as the 1993 massacre of mostly Alawite intellectuals in a hotel in Sivas.

People on the streets are to be congratulated for their resistance to the military takeover, but caution is warranted: There is a difference between protesting the army and asking for democratic reforms, and calling the crowd on the streets itself an army, with Erdogan the commander, as in one of the slogans that was frequently chanted Friday night: “İşte Ordu İşte Komutan” (Here is the army, here is the commander). History dictates that it is highly unlikely that the latter would bring us the liberal democracy Turkey still longs for.