ISTANBUL/ANKARA - Turkish authorities rounded up nearly 6,000 suspected military plotters on Saturday and ordered thousands of judges detained after thwarting a coup by rebels using tanks and attack helicopters to try to topple President Tayyip Erdogan, broadcaster NTV said on Sunday, citing Justice Minister Bekir Bozdag."The judicial process on this will continue," NTV reported Bozdag as saying.
For several hours overnight on Friday violence shook Turkey's two main cities, as the armed faction which tried to seize power blocked a bridge in Istanbul and strafed the headquarters of Turkish intelligence and parliament in Ankara.
At least 265 people were killed. An official said 161 of them were mostly civilians and police officers, while the remaining 104 were coup supporters.
But the coup attempt crumbled as Erdogan rushed back to Istanbul from a Mediterranean holiday and urged people to take to the streets to support his government against plotters he accused of trying to kill him.
"They will pay a heavy price for this," said Erdogan, launching a purge of the armed forces, which last used force to stage a successful coup more than 30 years ago. "This uprising is a gift from God to us because this will be a reason to cleanse our army."
Among those detained were top military commanders, including the head of the Second Army which protects the country's borders with Syria, Iraq and Iran, state-run Anadolu news agency said.
Hundreds of soldiers were held in Ankara for alleged involvement in the coup, leaving police stations overflowing.
Some had to be taken under armed police escort in buses to a sports stadium. Reuters footage showed some of the detainees, handcuffed and stripped from the waist up, sitting on the floor of one of the buses.
The government declared the situation under control, saying 2,839 people had been rounded up, from foot soldiers to senior officers, including those who formed "the backbone" of the rebellion.
Authorities also began a major crackdown in the judiciary over suspected links to US-based cleric Fethullah Gulen, removing from their posts and ordering the detention of nearly 3,000 prosecutors and judges, including from top courts.
Erdogan has blamed the coup on supporters of Gulen, who he has frequently accused of trying to foment uprising in the military, media and judiciary.
Ten members of the High Council of Judges and Prosecutors and two members of the Constitutional Court have already been detained, officials said.
A successful overthrow of Erdogan, who has ruled the country of about 80 million people since 2003, would have marked another seismic shift in the Middle East, five years after the Arab uprisings erupted and plunged Turkey's southern neighbor Syria into civil war.
However, a failed coup attempt could still destabilize the NATO member and major US ally that lies between the European Union and the chaos of Syria, with Islamic State bombers targeting Turkish cities and the government also at war with Kurdish separatists.
U.S. President Barack Obama expressed support for Turkey's government and urged parties on all sides of the crisis to avoid destabilizing the country and follow the rule of law. But his secretary of state, John Kerry, warned Turkish Foreign Minister Mevlut Cavusoglu that public suggestions of a U.S. role in the plot were "utterly false" and harmful to relations.
Erdogan, who had been holidaying on the southwest coast when the coup was launched, flew into Istanbul before dawn on Saturday and told thousands of flag-waving supporters at the airport that the government remained at the helm.
A polarizing figure whose Islamist-rooted ideology lies at odds with supporters of modern Turkey's secular principles, Erdogan said the plotters had tried to attack him in the resort town of Marmaris.
"They bombed places I had departed from right after I was gone," he said. "They probably thought we were still there."
Erdogan's AK Party has long had strained relations with the military, which has a history of mounting coups to defend secularism although it has not seized power directly since 1980.
His conservative religious vision for Turkey's future has also alienated many ordinary citizens who accuse him of authoritarianism. Police used heavy force in 2013 to suppress mass protests demanding more freedom.
He commands the admiration and loyalty of millions of Turks, however, particularly for raising living standards and restoring order to an economy once beset by regular crises, which grew 4.8 percent year-on-year in the first quarter.
The violence is likely to hit a tourism industry already suffering from the bombings, and business confidence is also vulnerable.