More than 1,500 military personnel were arrested across the country, said a senior official who was not authorized to speak to the media. The state-run Anadolu news agency said at least 90 people were killed in clashes and more than 1,100 were wounded. Colonels and generals implicated in the rebellion were fired and loyal troops rescued the military chief who had been taken hostage at an air base on the outskirts of Ankara.
RELATED: Bay Area Turks react to attempted Turkish coup
President Recep Tayyip Erdogan said coup supporters "will pay a heavy price for their treason to Turkey," according to a transcript of his remarks provided by his office. "Those who stain the military's reputation must leave. The process has started today, and it will continue just as we fight other terrorist groups."
Military chief of staff Gen. Hulusi Akar is taking over the command of the operation against the coup plotters, CNN-Turk said.
Fighting continued into the early morning, with the sounds of huge blasts echoing across Istanbul and the capital, Ankara, including at least one bomb that hit the parliament complex. Television footage showed images of broken glass and other debris strewn across a lobby leading to the assembly hall.
RELATED: The cleric being blamed for Turkey coup attempt
Government officials, who blamed the unrest on a U.S.-based Islamist cleric, said the coup failed as Turks took to the streets overnight to confront troops attempting to take over the country.
The chaos capped a period of political turmoil in Turkey which critics blamed on Erdogan's increasingly authoritarian rule, which has included a government shake-up, a crackdown on dissidents and opposition media and renewed conflict in the mainly Kurdish areas of the southeast.
Turkey, a NATO member, is a key partner in U.S.-led efforts to defeat the Islamic State group, and has allowed American jets to use its Incirlik air base to fly missions against the extremists in nearby Syria and Iraq. A coup against the democratically elected government could make it difficult for the United States to continue to cooperate with Turkey.
Erdogan flew into Ataturk airport early Saturday and was greeted by large crowds. He told them: "They have pointed the people's guns against the people. The president, whom 52 percent of the people brought to power, is in charge. This government brought to power by the people is in charge. They won't succeed as long as we stand against them by risking everything."
Turkey's Police Chief Celalettin Lekesiz said 16 coup plotters were killed in clashes at Turkey's military police command.
In images broadcast on CNN-Turk, dozens of soldiers walked among tanks with their hand held up, surrendering to government forces on Istanbul's Bosporus Bridge. Discarded gear was strewn on the ground. People, some holding flags, climbed onto the tanks.
Prime Minister Binali Yildirim has called all legislators for an emergency meeting Saturday, Anadolu reported.
U.S. President Barack Obama urged all sides in Turkey to support the democratically elected government. NATO Secretary-General Jens Stoltenberg said he spoke to Turkish Foreign Minister Mevlut Cavusoglu and called for respect for democracy.
RELATED: What you need to know about Turkey's political landscape
The coup attempt began late Friday, with a statement from the military saying it had seized control "to reinstall the constitutional order, democracy, human rights and freedoms, to ensure that the rule of law once again reigns in the country, for law and order to be reinstated."
Fighter jets buzzed overhead, gunfire erupted outside military headquarters and vehicles blocked two major bridges in Istanbul. Soldiers backed by tanks blocked entry to Istanbul's airport for a couple of hours before being overtaken by pro-government crowds carrying Turkish flags, according to footage broadcast by the Dogan news agency.
But the military did not appear unified, as top commanders went on television to condemn the action and order troops back to their barracks.
Confirming media reports of gunshots & possible attempted uprising in #Turkey. Remain vigilant.— Travel - State Dept (@TravelGov) July 15, 2016
Reports that social media is blocked in #Turkey. Use email/phone call/SMS to contact loved ones in area.— Travel - State Dept (@TravelGov) July 15, 2016