Turkish authorities rounded up nearly 3,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 Recep Tayyip Erdogan.

For several hours overnight on Friday violence shook Turkey's two main cities, as the armed faction that 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.