On May 27, 1960, the people of Turkey woke up to their first coup. Soldiers occupied centers of government, established checkpoints, took over communications stations, and announced that Adnan Menderes, the prime minister at the time, had failed as a statesman, and that the military was there to stabilize the country.

Menderes was loved by a conservative base similar to President Erdogan and the AK Party’s voters today, but no one went out on the streets to protest. Menderes was tried by the coup’s court, found guilty of treason, and hanged. His supporters stayed in their homes, cried, and then went about their business. The Republic of Turkey nominally belonged to the people, but the people knew that it had never really been theirs. Whatever power they possessed was loaned to them by an elite, and that elite now wanted it back.

This set a grim precedent, and Turkish democracy suffered through coups almost every decade afterwards.

When the AK Party first came to power 2002, the possibility of a coup was very real for several years. Its Islamist past jibed badly with the military leaders of the time. But the AK Party leadership played a balancing game, promising to continue Turkey’s efforts to join the European Union in return for being able to govern. Over the years, cemented its place in power and supposedly defanged the military.

So when I heard low-flying jets while sitting in my Ankara apartment, I didn’t think it could be a coup. The first thing that came to mind was the possibility of a terrorist attack. ISIL has been increasingly targeting Turkey, and only the day before there had been a bloody attack on civilians in Nice. I received several calls from people asking me what was going on, and though we discussed the possibility of a coup, we all thought the chances were low. That sort of thing was done with.

Only very slowly did we come to understand what it was. In a phone-in with a news channel, the prime minister said that it was “an uprising” among some in the military, and that it would be put down quickly. Then came statements from the junta. It was calling itself the “Yurtta Sulh Konseyi,” meaning “Peace at Home Council,” a play on the famous words of Mustafa Kemal Atatürk, the founder of modern Turkey. Like coups before it, it was trying to take control of or suppress government organs and communications channels. The state television broadcast was stopped, and a speaker read a text stating that the government had failed in its duties and that the military was taking control of the situation. All of Turkey’s international obligations would be honored, everybody should just stay home, it said. I actually pinched myself to make sure it was real.

Unlike in decades past, however, Turks had plenty of private channels to flick around on to see what was going on and receive instructions. Twitter and Facebook were blocked, but slightly tech-savvy people just used VPNs (virtual private networks) to connect. The coup plotters must have thought that they could do their work without effectively blocking communications.

I left my apartment because it felt wrong to sit there while things were happening outside. There were no bombs going off yet, but low-flying jets made for an ominous feeling, and the streets were empty. I stuck to side alleys and made my way to a friend’s place. Only in one place did I have to cross the Cinnah boulevard, which leads to the old presidential palace. It was quiet until I heard a rumbling from below and saw the lights of an unusually large vehicle climbing up the hill. The tank was followed by six to nine more. I could see the soldiers on top of them, and it occurred to me that I must be one of the very few, if not the only person they’d seen on the streets. I turned away awkwardly and stuck out my phone to record their ascent.

I arrived at my friend’s place and we watched the news. It looked as if President Erdogan was in mid-flight returning from a vacation, and then he connected to CNN Turk through a Facetime call. It was surreal watching the president addressing two journalists from a cell phone screen. Saying that the coup attempt was led by a small cadre within the military, he called on citizens to take to public squares and airports to face the tanks. “Whatever they will do to the people, they should do it there. I have not recognized a power greater than that of the people, and will not ever do so.”

This was a big deal. Conservatives in Turkey since Menderes’ time were a silent majority. But today, after nearly 15 years of being in government, they had changed. They would fight, and there would likely be blood. When I called friends in the AK Party, they were already on their way to the party’s headquarters or to the airport. Social media accounts close to the government were calling on everyone to take to the streets, no matter the cost.

But there was not a peep where I was in Ayrancı and Gaziosmanpaşa, some of Ankara’s most affluent districts. One friend, a teacher in a private school in Istanbul, was terrified of the sound of jets, and when I approached the window, she implored me to back away. I went out to walk to Kugulu Park, thinking that there might be a few people to rally there, but there wasn’t. Most secular liberals, the people who had faced police and tear gas during the Gezi Park protests in 2013 were staying put. This does not mean that they were happy about the coup – none I spoke to were – but rather that their fear was more pronounced than their anger.

The booming of jets was near-constant, but was now met with chants from mosques. At first it was a standard call to prayer, which was odd, since it was well past prayer time. By authority of the president and head of Diyanet, Turkey’s religious authority, loudspeakers called upon people to leave their homes and occupy central locations in resistance to the coup. Most of the rest was “sala,” Islamic chants or messages spread from the minarets of mosques. The people’s resistance would have an Islamic character.

Soon it became clear from social media and noise coming from the region that people had gathered in front of parliament. Chants of takbir (“Allahu Akbar,” meaning “God is great”) began to rise from the distance. It was audible kilometers away, punctuated only by machine gun fire, the booming of jets, and the bombs falling on parliament. I approached parliament alone, but saw that there were soldiers on their way to the front of the building, where the crowd was. What appeared to be an armored personnel carrier with young soldiers holding a Turkish flag drove away, which made me think that they were done dispersing the crowd of civilians resisting the soldiers.

There were still soldiers though, and being the desk jockey I am, I stayed back. A hospital nearby had taken some of the sick beds into the lobby, presumably because they thought they might have to evacuate the hospital quickly. People looked scared. A bunch of us huddled together to watch Erdogan’s message from Atatürk airport in Istanbul, where he had finally landed. Various theories about Fethullah Gülen, the sonic booms of jet engines, and Erdogan’s vacation residence made the rounds. By the time I got home (to my mother’s elation), the sun was beginning to come up. I got a couple of hours of sleep, showered, and made my way to parliament, which was now cleared of the junta.

There was a crowd of hundreds if not thousands of people still there. Vans were dropping off bottles of water and Turkish flags. Having won the night’s battle, many were resting under the shades of the trees across the street from the police headquarters. Then a group of police special forces arrived, and hundreds streamed up front to greet them. There were designated people to keep the crowd from crushing them. Chants of “polise uzanan eller kırılsın,” (“may the hands seeking to harm the police be broken!”) and “Türkiye sizinle gurur duyuyor!” (“Turkey is proud of you!”) rose from the crowd. The most popular chant by far however, was “Allahu Akbar,” and there was a vindictive feeling in the takbir, as if it that elation had been caged up for too long.

These people were not from my neighborhood up the hill, but from Ankara’s various poorer districts. An overwhelming majority were male, with lean faces and sunburnt skin. Rather than the urbane “Istanbul Turkish,” they spoke in various Anatolian accents, and a few wore traditional Islamic garb the way Arabs do. Many used hand signs with their slogans, either the sign of takbir, an extended index finger (which in Turkey suggests political Islamism) or the sign of the gray wolf, (which belongs to the nationalist party). It was these people who had faced down the junta’s tanks.

Many Turks on the left are already uncomfortable with this, pointing out that the same group is known for beating up journalists and oppressing minority groups. Their actions, they say, were more motivated by the will to hold on to power than by a love for democracy. They have a point, but it doesn’t change the fact that the night could well have been lost if not for their actions.

The crowd now gathered in front of the police headquarters, and the police were having a hard time containing it. A police chief climbed on top of something and held up a framed photo of Erdogan. It was hard for him to speak through the crowd’s chanting, but when he did, it was generally to calm down the crowd, tell them to go home, or insult the Gülenists. All the while, he held up the president’s framed photo for so long that it made me wonder how his arm wasn’t getting tired. The crowd was now calling for the junta to be put to death.

Around noontime, more people started to arrive. There were now more women, older people, men wearing shorts and women without headscarves. The secular types were joining the party. There were now occasional recitations of the national anthem, as well as the “10th year march,” both of which suggest secular republican sensibilities. But the larger crowd went along, and the mood was festive. People were passing out water to each other, and I spotted prayer groups as I was leaving.

It is difficult to make predictions about how the coup attempt will change things in Turkey. What is certain is that the country’s major political factions will often refer to it to define themselves in the future. The opposition will be rightly proud of having denounced it early on, before anyone knew which way it would go. Secular-leaning media organizations like Dogan News, which owns CNN Turk, will point out that they resisted the junta even as its forces entered its building.

But more than anything else, the 15th of July will be remembered as a pivotal moment for the political right. Erdogan and his cadre have been mentally preparing for a coup ever since they rose to power in 2002. The danger was especially high during the AK Party government’s initial years and always remained on their minds since. It is true that as far as coups in Turkey go, this one was poorly planned and lacking in execution, but that won’t matter. The AK Party’s nearly 15-year long struggle to tame the leviathan now feels complete. The party’s conservative base feels an ownership of the state like never before.

It is hard to predict where things will go from here. At worst, the coup will encourage the AK Party’s worst attributes and serve as a stepping-stone to a regime that will make the country inhospitable to others. At best, it will be a uniting force in the country’s politics that leads to a new consensus. Time will tell.

Selim Koru is an analyst at the Economic Policy Research Foundation of Turkey (TEPAV), where he focuses on Turkey’s relations with the Middle East and Asia. You can follow him @SelimKoru.