Turkish President Recep Tayyip Erdogan has flown in to Istanbul, after an army group said it took over the country.
He was seen surrounded by cheering supporters, and said the coup attempt was an “act of treason” and the army must be cleansed in a live TV speech.
Sixty people died during overnight clashes, many of them civilians, and 336 people were arrested, officials said.
Prime Minister Binali Yildirim said the situation was largely under control.
He has ordered the military to shoot down aircraft being used by coup plotters.
Earlier, one of the helicopters being flown by forces involved in the coup attempt was shot down over the capital Ankara.
Meanwhile, the whereabouts of the military chief of staff, Gen Hulusi Akar, are still unknown. He is reported to have been taken hostage by rebel soldier.
Sporadic gunfire is still reported in major cities.
Reports also say rebel soldiers in some areas have been surrendering their weapons to police loyal to Mr Erdogan.
The surrender of one unit of 60 soldiers, who had taken control of one of the Bosphorus bridges in Istanbul, was shown live on TV on Saturday morning.
Istanbul’s main Ataturk airport is now under army control, and flights – which had been interrupted for some hours – were due to resume from 06:00 (03:00 GMT).
It is unclear who is leading the plotting army group, or how much support it enjoys.
The group earlier declared that a “peace council” now ran the country and there was a curfew and martial law.
Read the latest live updates
Soldiers were seen at strategic points in Istanbul, with jets flying low in Ankara.
Two large explosion were also heard near Istanbul’s central Taksim Square.
There were also reports of blasts at parliament building in Ankara. MPs were believed to be hiding in shelters.
Broadcaster CNN Turk was reportedly taken over by soldiers, and its live broadcast was cut.
In Washington, US President Barack Obama urged all parties in Turkey to support the “democratically elected government”.
Nato called for “full respect” for Turkey’s democratic institutions.
European Council President Donald Tusk said the country was “a key partner for the European Union”.
“We call for a swift return to Turkey’s constitutional order,” he added.
The Bosphorus bridge was blocked off by military unitsImage GETTY IMAGES
The Bosphorus bridge was blocked off by military units
Erdogan supporters protest in front of soldiers on Istanbul’s Taksim Square. Photo: 16 July 2016Image AP
Erdogan supporters gathered on Istanbul’s Taksim Square for a protest rally
A man stands in front of a Turkish army tank at Istanbul’s Ataturk airport. Photo: 16 July 2016Image REUTERS
One protester tried to block tanks at Istanbul’s Ataturk airport
Speaking in Istanbul in the early hours on Saturday, President Erdogan promised to clean up the army.
“Those who drive around in tanks will have to go back to where they came from,” he said.
He also dismissed the coup leaders as “terrorists”.
Mr Erdogan earlier told CNN Turk by mobile phone the action was by a “parallel structure” that would bring the necessary response. He has used this term in the past to refer to Fethullah Gulen, a US-based Muslim cleric he accuses of fomenting unrest.
Fethullah Gulen: Powerful but reclusive Turkish cleric
However, in a statement, Mr Gulen rejected any suggestion he had links to the events.
“I condemn, in the strongest terms, the attempted military coup in Turkey,” he said.
Mr Erdogan had called on people to take to the streets to oppose the uprising.
He said: “I urge the Turkish people to convene at public squares and airports. I never believed in a power higher than the power of the people.”
The president said he had returned to Istanbul from the holiday resort of Marmaris in the south-west of the country. He said the town was later bombed,
Media “Here in Turkey there is confusion”, reports the BBC’s Katy Watson
Defying the announced curfew, a number of Erdogan supporters turned out on Taksim Square in Istanbul late on Friday.
There were reports of clashes there, with some on Twitter saying that gunfire had been heard near the square.
After the military takeover was announced, a statement from the group was read out on national broadcaster TRT. It said that the democratic and secular rule of law had been eroded by the current government. There would be new constitution, it said.
Mr Erdogan spoke to CNN Turk via FacetimeImage GETTY IMAGES
Mr Erdogan spoke to CNN Turk via Facetime
Mr Yildirim told NTV by telephone: “There was an illegal act by a group within the military that was acting out of the chain of military command. Our people should know that we will not allow any activity that would harm democracy.”
Traffic was stopped from crossing both the Bosphorus and Fatih Sultan Mehmet bridges in Istanbul.
Police were standing guard outside the Turkish military HQ in AnkaraImage GETTY IMAGES
Police were standing guard outside the Turkish military HQ in Ankara
Gunfire was also heard outside Istanbul police HQ and tanks were said to be stationed outside Istanbul airport.
Turkey’s military coups
1993 – Claims of a “covert coup” intended to prevent a peace settlement with the Kurdistan Workers’ Party (PKK)
1980 – Military coup following armed conflict between right-wing and left-wing groups in the 1970s
1971 – Military coup known as the “coup by memorandum”, which the military delivered instead of sending out tanks
1960 – Coup by group of young military officer outside chain of command, against the democratically-elected Democrat Party
Story by -BBC