UPDATE (2.50PM): Total of 1,563 military personnel arrested after Turkish coup attempt.
Turkey's military headquarters are now held by pro-government forces but small groups of rebel soldiers behind an overnight coup attempt are still resisting and control some military helicopters, a senior Turkish official said on Saturday.
The official said the pro-coup soldiers did not control any fighters jets and that the helicopters they were still using would be brought down swiftly.
Attacks on parliament and the presidential palace had largely stopped, the official said. A second official said 29 colonels and five generals had been removed from their posts in the wake of the coup attempt.
A Turkish army faction backed by tanks and fighter jets was waging a coup attempt against President Recep Tayyip Erdogan on Saturday, but the strongman returned to Istanbul defiantly claiming to have regained control.
Soldiers and tanks took to the streets late on Friday and multiple explosions rang out throughout the night in Ankara and Istanbul, the two biggest cities of the strategic NATO country of 80 million people.
With officials insisting the takeover bid was falling apart, officials said 60 people have been killed and 754 detained in a night of violence in Turkey's major cities.
Dozens of soldiers backing the coup surrendered on the Bosphorus bridge in Istanbul that they had held throughout the night, holding their hands above their heads as they were detained, television pictures showed.
Erdogan predicted that the putsch would fail and crowds of supporters of the ruling Justice and Development Party (AKP) came out onto the streets to try to block it.
After hours of chaos unseen in decades, the president ended uncertainty over his whereabouts, flying into Istanbul airport in the early hours where he made a defiant speech and was greeted by hundreds of supporters.
Erdogan denounced the coup attempt as "treachery" but said he was carrying out his functions and would keep on working "to the end".
"What is being perpetrated is a treason and a rebellion. They will pay a heavy price for this act of treason," Erdogan said at the airport. "We will not leave our country to occupiers." The sound of F16 fighter jets flying over the capital Ankara signalled the start of the putsch late Friday, with troops also moving to block the bridges across the Bosphorus Strait in Istanbul.
As protesters took to the streets, an AFP photographer saw troops open fire on people gathered near one of the bridges, leaving tens wounded.
Soldiers also opened shot at protesters angrily denouncing the coup bid at Istanbul's famous Taksim Square, injuring several.
Turkish army F-16s launched air strikes against tanks stationed by coup backers outside the presidential palace in Ankara, while the parliament was also bombed.
Regular explosions could be heard from the AFP office situated near the complex.
World leaders called for calm, with US President Barack Obama and other Western countries urging support for the government which they said had been elected in democratic elections.
The night of drama and bloodshed brings new instability to the Middle East region, with Turkey a key powerbroker in the ongoing Syria conflict.
With uncertainty over the fate of Turkey's top general Hulusi Akar - reportedly taken hostage - General Umit Dundar, commander of the First Army, has been appointed as acting chief of staff, Prime Minister Binali Yildirim said.
After the initial dramatic military movements, state broadcaster TRT said the troops behind the putsch had declared martial law and a curfew, in a statement signed by a group calling itself the "Council for Peace in the Homeland".
"The power in the country has been seized in its entirety," the statement said.
It said the coup had been launched "to ensure and restore constitutional order, democracy, human rights and freedoms and let the supremacy of the law in the country prevail, to restore order which was disrupted".
No named military officer claimed responsibility for the actions although Yildirim claimed a key pro-coup general had been killed.
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's critics have long accused him of undermining modern Turkey's secular roots and of sliding into authoritarianism - but the president was believed to have won control of the military after purging elements who opposed him.
The Turkish strongman urged people to rally in his support, prompting hundreds of supporters to gather in Turkey's three main cities of Ankara, Istanbul and Izmir, AFP correspondents said.
There was chaos in Istanbul as angry crowds took to the streets to boo the passing tanks, with smaller numbers welcoming the troops.
As a helicopter flew over the famed Taksim Square, scene of massive anti-Erdogan protests three years ago, the crowd began to boo, shaking their fists at the night sky before they were shot at by the soldiers.
"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." But some Turks were welcoming news of the coup attempt.
"Turks are on fire," Fethi, a 27-year-old tour guide in Taksim Square, told AFP.
"We have hope now," he added. "Turkey has been in a very polarised state for almost 15 years now... This is the manifestation of all that anger." Erdogan immediately pinned the blame on "the parallel state" and "Pennsylvania" - a reference to Pennsylvania-based cleric Fethullah Gulen, his arch-enemy who he has always accused of seeking to overthrow him.
But the president's former ally denied any involvement in the plot, calling the accusation "insulting".
"As someone who suffered under multiple military coups during the past five decades, it is especially insulting to be accused of having any link to such an attempt. I categorically deny such accusations," he said in a statement.
Turkish airlines said flights to Istanbul's main international airport had resumed after a night-long shutdown. The Bosphorus bridges remained closed.
There has been a flood of concerned reactions from around the globe, with EU foreign policy chief Federica Mogherini calling for "restraint and respect for democratic institutions".
Obama has been briefed, while the Kremlin said it was "deeply concerned" by the developments.
"Everything must be done to protect human lives," said a spokesman for German Chancellor Angela Merkel.