People apprehend a Turkish soldier, third right in blue, that participated in the attempted coup, on Istanbul's Bosporus Bridge, Saturday, July 16, 2016. (Photo: AP)
Turkish authorities rounded up dozens of senior military personnel and judges in a ruthless crackdown Sunday, after thousands massed in the streets nationwide overnight to denounce a coup aimed at ousting President Recep Tayyip Erdogan.
World leaders including US President Barack Obama have strongly condemned the attempted putsch but also urged Turkey to respect the "rule of law" in its aftermath, especially after pictures emerged showing the rough treatment of some coup plotters when arrested.
According to the government, 161 civilians and regular troops lost their lives when a group within the army sought to overthrow the authorities by seizing key strategic points in Istanbul and Ankara.
Over 100 coup plotters were also killed, the military has said.
The botched coup bid marked the biggest challenge to Erdogan's rule in 13 years as prime minister and now president. But he successfully mobilised supporters into the streets to face down the plotters.
Thousands responded late Saturday to a new call by the president to pour into the squares to celebrate the "victory of democracy" with mass rallies of flag-waving Turks reported in cities including Ankara, Istanbul and Izmir.
The Turkish authorities have made clear they will show no mercy in the wake of the coup, accusing the plotters of acting on behalf of Erdogan's arch enemy, the US-based preacher Fethullah Gulen.
The government has already said that almost 3,000 soldiers had been detained on suspicion of involvement in the putsch which raised fears of chaos in the strategic NATO member state of almost 80 million.
Turkish television has shown images of captured coup plotters forced to lie face down on the tarmac after arrest while AFP photographers have seen suspects roughly led away pursued by angry mobs.
NTV television said that 34 generals of various grades had been detained so far. They include senior figures like Erdal Ozturk, commander of the third army and the commander of the Malatya-based second army, Adem Huduti.
In an operation early Sunday, authorities detained the commander of the garrison in the western town of Denizli, Ozhan Ozbakir, along with 51 other soldiers, according to the state-run Anatolia news agency.
Turkey also detained a senior air force general and other officers accused of backing the failed coup at a key air base used by US forces for raids in Syria.
Brigadier air force general Bekir Ercan Van was detained along with over a dozen lower ranking officers on Saturday at the Incirlik air force base in Turkey's southern Adana province, newspapers including the Hurriyet daily said.
The base has become a key hub for US forces after Turkey last year agreed to allow the United States to use Incirlik to carry out lethal raids against jihadists in Syria.
The crackdown is however not restricted to the military and Anadolu said that prosecutors have issued arrest warrants for a total of 2,745 judges and prosecutors across Turkey.
The entire investigation is being led by Ankara prosecutors and those arrested are suspected of belonging to Gulen's group, which Turkey dubs the "Fethullahci Terror Organisation (FETO)".
Gulen's supporters say their group which they call Hizmet (Service) is entirely peaceful.
US President Barack Obama has warned Turkey there is a "vital need" for all parties to "act within the rule of law" in the aftermath of the coup.
While condemning the coup bid, German Chancellor Angela Merkel also said the plotters had to be dealt with "under the rule of law".
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.
Erdogan has pinned the blame on Gulen, a former ally who he accuses of running a "parallel state", and called on Obama to extradite the reclusive preacher to face justice.
"Mr President, I told you myself, either deport or hand over to us this person who lives in 400 acres of land in Pennsylvania," he told a triumphant rally in Istanbul late Saturday, carefully not referring to Gulen by name.
But Gulen "categorically" denied any involvement in the plot, calling the accusation "insulting".
Meanwhile, Turkey has demanded the extradition of eight people thought to have been involved in the putsch who landed in a Black Hawk military helicopter in Greece.
The suspects are still in Greece, but the chopper itself is now been flown back to Turkey, a Turkish official said.
Istanbul authorities have sought to get life back to normal, resuming service at Ataturk International Airport, which was shut down by the plotters.
But Washington on Saturday warned citizens against travel to the country, suspending flights and banning all airlines from flying to the United States from Turkey due to uncertainty after the coup bid.