When Turkish military officers set in motion an attempted coup d’état on the night of July 15, lawmakers in the capital, Ankara, rushed to the parliament building. As explosions rocked the capital and President Recep Tayyip Erdogan was nowhere to be seen, it appeared the MPs might be making their last stand in defense of Turkey’s democracy. As he headed to the government headquarters, opposition lawmaker Mahmut Tanal brought a copy of the Turkish constitution. Another, Orhan Atalay from Erdogan’s ruling AKP party, grabbed his gun.
Some 30 lawmakers soon assembled in parliament, with both government and opposition supporters declaring their opposition to the attempted putsch even as a aircraft opened fire on the building. It was a rare moment of unity in a country that had become bitterly divided in the runup to the attempted coup. Leaders of rival political camps took shelter together, united in defiance of the coup—and fear for their lives.
Although the coup seemed an amateur affair in some initial reports, Turkish and U.S. officials now believe the attempted coup was a serious and well-armed bid for power that came within a hair’s breadth of succeeding. The coup plotters commanded tanks, helicopters and F-16s. They opened fire on crowds, invaded television studios and shelled the main parliament building. By his own account, Erdogan narrowly avoided capture and possibly execution, fleeing minutes before troops raided his hotel in the Turkish seaside town of Marmaris, where he had been on vacation. It wasn’t until the next morning, after Erdogan had rallied his supporters to the streets, that it became clear the attempt had failed. Some 280 people were killed, according to the President, including more than 100 coup participants.
At the heart of the insurrection was the attack on Turkey’s parliament, the Grand National Assembly. Three lawmakers who were in the building described to TIME a night of terror and confusion as MPs struggled to make sense of the chaos and the building came under attack from the air—a striking symbol of the coup’s assault not just on Erdogan’s government but on the core institutions of Turkish democracy.
Read More: How John Kerry Handled Turkey’s Coup
On the night of the coup attempt, parliament member Mahmut Tanal was at a Bar Association office in Ankara when he heard fighter jets flying low over the capital. He checked social media, and saw that soldiers had blocked bridges in Istanbul. He soon heard of an attack on the intelligence headquarters in Ankara and other violence around the country. As a member of the secular opposition Republican People’s Party, Tanal feared arrest should the military seize power. A student of Turkey’s history with military coups, which includes four changes of government since 1960, Tanal had a dark notion of what was coming. Rather than go home, he figured he stood a better chance of avoiding arrest in the fortified parliament complex where other MPs were gathering.
The 55-year-old stopped at his house to pack a bag of items he might need in prison, including a change of clothes, and a copy of the constitution, which he imagined he’d read over and over in prison. “I’m a lawyer and a member of the human rights committee in parliament. Because of this, I know what’s needed in jail,” he says in an interview in office in the parliament compound, five days after the failed coup.
In a different part of the city another lawmaker, Orhan Atalay, of Erdogan’s ruling Justice and Development Party (AKP), was at home when he heard the sound of an explosion. After making some calls, he learned that a coup attempt was underway. He took his gun and as he got in his car, heard yet another explosion, this time at a nearby police headquarters. “I saw the flames with my own eyes,” he says.
Atalay, who is 50 and lean with a bristling black mustache, says he was the second MP to arrive at the building, at around 9 p.m. Lawmakers from three major parties soon gathered in the main parliament hall. Selahattin Demirtas, the co-leader of the pro-Kurdish Peoples’ Democratic Party, sent a message saying the party’s deputies were outside the capital and unable to reach the parliament, but that they rejected the coup and expressed solidarity with the besieged lawmakers. Speaker Ismail Kahraman delivered a defiant address, declaring the parliament still in session.
Even as he spoke, the lawmakers heard the sound of an explosion, an apparent bombing nearby. Ten minutes later, there was a second blast, this time a direct attack on the parliament building, prompting shouting and chaos inside the chamber. Footage posted online showed posted shows a speaker interrupted by a crashing sound that shakes the room, triggering shouting among the MPs. A pilot later said that he bombed the parliament from an F-16 fighter jet, according to testimony reported on August 3 by the Turkish newspaper Hurriyet.
The blasts continued as the night drew on. After midnight, the lawmakers abandoned the Plenary Hall for an underground shelter in the basement of the building. They then separated into small groups, following different passages in the labyrinthine basement of the parliament. The idea was to make it harder for anyone to capture all of the deputies at once. The small groups included members of parties usually opposed to each other. Weeks earlier, rival MPs had wrestled each other in a physical brawl over legislation to strip lawmakers of legal immunity, which later passed. Now, facing arrest or death, party distinctions melted away. “There was no separation of groups, we were just human beings trying to survive,” says Tanal.
Tanal spoke to TIME as he surveyed the damage at the main parliament building on July 19, five days after the failed coup attempt. Shelling shattered a tall glass atrium, leaving shards of glass crunching underfoot. One shell blew a massive hole in an upper floor of the building, chunks of concrete and rebar dangling in the open air. In the prime minister’s office, the windows had been blown out. Heaps of office furniture, broken computer equipment and other debris remained, the result of a haphazard cleanup.
As the MPs were evacuating the main parliament chamber, Erdogan made his first public statement since the launch of the coup attempt. He appeared not in a TV studio or a government office but via video chat on a newscaster’s phone, in a moment that suggested a tenuous grasp on power at best. He nevertheless struck a defiant tone, urging the Turkish public to take to the streets in rejection of the coup. “I am also on my way,” he said. Crowds of protesters soon responded to the president’s call, taking to the streets of both Istanbul and Ankara, where demonstrators faced tanks in the plaza outside parliament.
Both Atalay and Tanal said that for a long stretch of the evening they did not know whether the coup would succeed or fail. According to both lawmakers, the turning point came when Umit Dundar, the commander of Turkey’s first field army, which is headquartered in Erdogan’s power base of Istanbul, announced he was backing the government, saying that section of the army had been decisive in past coups. “Until the explanation of the commander of the first army, we were really not sure, whether it would succeed or not,” says Atalay. “When the commander of the first army supported the government, we said they would fail.”
As the sun rose on July 16, silence fell over Ankara and the sheltering MPs began to gingerly peer out of the parliament headquarters. Everywhere in the compound there were security men, including some the lawmakers recognized, and others they didn’t. “There were also some more cops who were brought from the central headquarters because of the state of emergency. But everybody was scared of each other. There was a situation of distrust,” says Tanal. Some police he had previously known walked him to his car. To his surprise, his car was intact, unscathed by the shelling. In the early morning sun, he drove home.