Kiran Nazish

Special for USA TODAY

ISTANBUL — It was 2 a.m. Saturday and a demonstrator at the main Taksim Square here summed up what everyone was thinking: "No one knows what's going on."

No police or security forces could be seen in the darkness, as Army helicopters ringed the sky without headlights. Even soldiers supporting an attempted coup seemed confused about who was in control of the country, the elected government or a group of military plotters.

After an official announcement by the government that the coup had failed, soldiers who had backed the attempted takeover slinked away from pro-government crowds holding flags and chanting, "God is the greatest. God is great!"

As the confusion gave way to certainty that the coup was defeated, hundreds poured into the square, where some demonstrators dragged soldiers out of their tanks and kicked them and beat them with sticks. Some chanted, "Go back to your barracks" and "Traitor, terrorist." One image that went viral showed pro-government demonstrators lynching a soldier on a bridge over the Bosphorus Strait.

As the sun came up, people were shocked and angered to learn that 265 were killed and 1,400 were injured in fighting overnight, according to the government, now back in the control of President Recep Erdogan.

Erdogan: Coup crushed, plotters to pay a 'heavy price'

"They (coup supporters) are terrorists, and they deserved to be burnt in hell, but first we will punish them here," said protester Salem Oztuk, 27, a restaurant worker. "Erdogan is our leader, and these cowards are his enemy. They are the enemies of the people."

Erdogan, who gained new sympathizers from Turks who favor continued democracy, if not his policies, called the coup an “act of treason” and warned that the perpetrators will pay a “heavy price.” Prime Minister Binali Yildirim called the attempt a “black stain for Turkish democracy.”

By Saturday night, people poured into the streets to celebrate the failed coup. At Taksim Square, tens of thousands in a festive mood sang, whistled and waved red and white Turkish flags.

"We cheer for democracy. We cheer for Erdogan," said Elif Dogul, 24, an artist from Istanbul. "I can now have my exhibition" scheduled in several weeks, Dogul said.

Demonstrator Murat Yildiz, 37, a restaurant worker, added, "If Turkey can fight all its coups like this ... then we can win all our wars."

Temir Yural, a researcher at Ataturk University, said most of the demonstrators on the streets are anti-coup more than pro-Erdogan. "They are here to say, 'We don't want the military; we want democracy,'" Yural said. "It is very important to identify this, looking at Turkey's precarious situation today."

"People's fear of violence is increasing" because of so many recent terrorist attacks in Turkey, he said, adding that many are more mindful of recent military coups in Turkey.

"Mostly they still remember the violence and bloodshed on the streets from the number of military interventions in the past," Yural said. "That is a horror they don't want anymore."