Turkish authorities wrested back control of the country Saturday, after crushing a military coup by discontented soldiers seeking to seize power from President Recep Tayyip Erdogan that claimed more than 250 lives.
After facing down the bloodiest challenge to his 13-year rule, Erdogan urged his backers to stay on the streets to prevent a possible "flare-up" of Friday's chaos in the strategic NATO member of 80 million people.
The authorities blamed Fethullah Gulen, the US-based cleric who is Erdogan's arch enemy, for the plot and lost no time in rounding up 2,839 soldiers over alleged involvement amid concerns of the extent of the retribution.
Turks woke up early Saturday to television pictures showing dozens of soldiers surrendering after the failed coup, some with their hands above their head, others forced to the ground in the streets.
"The situation is completely under control," Prime Minister Binali Yildirim said outside his Ankara offices, flanked by Turkey's top general who had himself been taken hostage by the plotters.
Describing the attempted coup as a "black stain" on Turkey's democracy, Yildirim said 161 people had been killed in the night of violence and 1,440 wounded.
General Umit Dundar, who stood in as acting chief of staff while Hulusi Akar was being held by the rebels, said 104 coup plotters has been killed. Akar was later rescued in an operation that marked the end of the plotters' hopes.
During a night where power hung in the balance, large crowds of flag-waving supporters of Erdogan's ruling Justice and Development Party (AKP) defied the coup leaders' orders of a curfew and flooded the streets to block the attempt to overthrow the regime.
"We should keep on owning the streets tonight no matter at what stage (the coup attempt is) because a new flare-up could take place at any moment," Erdogan warned on Twitter on Saturday.
Friday's putsch bid began with rebel F-16 jets screaming low over rooftops in Ankara, soldiers and tanks taking to the streets and multiple explosions throughout the night in the capital as well as the biggest city Istanbul.
Parts of parliament were turned to rubble after being hit by air strikes from rebel jets.
Rebel troops also moved to block the two bridges across the Bosphorus Strait in Istanbul, culminating in a stand-off with an angry crowd.
Turks have not seen such scenes since 1980 when the military led by general Kenan Evren ousted the government and many had no desire to revive these memories.
As protesters poured onto the streets, an AFP photographer saw troops open fire on people gathered near one of the bridges, leaving dozens wounded.
Soldiers also shot at protesters angrily denouncing the coup bid at Istanbul's Taksim Square, injuring several.
There was chaos in Istanbul as angry crowds jeered the passing tanks, with much smaller numbers welcoming the troops.
"The people are afraid of a military government," a 38-year-old man who gave his name as Dogan told AFP. "Most of them have been in military service, they know what a military government would mean."
While condemning the coup bid, German Chancellor Angela Merkel said that the coup plotters had to be dealt with "under the rule of law".
Judicial authorities said 2,745 judges would also be sacked in the wake of the coup bid.
Erdogan, who flew back from the holiday resort of Marmaris to a triumphant welcome from supporters at Ataturk Airport, said the plotters "will pay a heavy price for this act of treason."
The president's critics have long accused him of undermining modern Turkey's secular roots and of sliding into authoritarianism -- but he was believed to have won control of the military after purging elements who opposed him.
Turkey's once-powerful military has long considered itself the guardian of the secular state founded by Mustafa Kemal Ataturk in 1923.
It has staged three coups since 1960 and forced out an Islamic government in 1997.
Erdogan immediately pinned the blame on "the parallel state" and "Pennsylvania" -- a reference to Gulen, his arch-enemy whom he has always accused of seeking to overthrow him.
But the president's former ally "categorically" denied any involvement in the plot, calling the accusation "insulting".
Yildirim took aim at the United States for hosting what he called "the leader of a terrorist organisation."
Speaking in Luxembourg, US Secretary of State John Kerry invited Turkey to hand over any evidence it had against Gulen.
Meanwhile, Turkey demanded the extradition of eight people thought to have been involved in the putsch who landed in a Black Hawk military helicopter in Greece.
And Istanbul authorities sought to get life back to normal with the bridges reopening to traffic and Ataturk International Airport -- shut down by the plotters -- gradually reopening.
But the US government said it has suspended all flights to Turkey, and banned all airlines from flying to the United States from Turkey due to uncertainty after the coup bid.
Turkish authorities also imposed a security lockdown at the Incirlik air base in the southern province of Adana used by US and other coalition forces in the fight against jihadists in Syria, the US consulate said.
The US military command in Europe has ordered American forces across Turkey to take maximum protective measures.