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, saying in a live TV speech that the coup attempt was an “act of treason” and the army must be cleansed.
Sixty people died during overnight clashes, many of them civilians, and 754 soldiers 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.
An army group on Friday said it had taken over the country, with soldiers at strategic points in Istanbul and jets flying low in the capital, Ankara.
A statement read on TV said a “peace council” now ran the country and there was a curfew and martial law.
Erdogan had said he would overcome what he called an uprising by a minority.
He 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.
Mr Erdogan 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.”
Mr Erdogan said he was on his way to Ankara and those involved in the action would pay a heavy price.
Yildirim had earlier denounced an “illegal action” by a military “group”, stressing it was not a coup. He said that the government remained in charge.
The military group’s statement on national broadcaster TRT, read by an announcer, said that democratic and secular rule of law had been eroded by the current government. There would be new constitution, it said.
A Turkish presidential source told Reuters news agency that the statement was not authorised by the army’s command.
There are reports Turkey’s top general, General Hulusi Akar, is among those taken hostage at the military HQ.
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.”
Turkey, a member of NATO, has experienced at least three military coups since 1960. The last attempt, which occurred in 1997, forced the resignation of then-prime minister Nemettin Erbakan. The ruling AK Party has been in power since 2002.