The United States is calling on all parties in Turkey to support President Tayyip Erdogan's government as world leaders expressed concern about the upheaval in the NATO member country.
President Barack Obama and Secretary of State John Kerry spoke by phone and gave their support to Mr Erdogan after Turkey's military said it had seized power on Friday.
By early Saturday, Mr Erdogan appeared to have regained control.
"The President and Secretary agreed all parties in Turkey should support the democratically-elected government of Turkey, show restraint, and avoid any violence or bloodshed," the White House said in a statement.
Mr Erdogan has ruled Turkey since 2003 and if the coup against him was successful it would have been one of the biggest shifts in the Middle East in years.
The sharp-tongued Mr Erdogan is often accused of authoritarian rule at home and has frequently fallen out with neighbours such as Israel, Iran, Russia and the European Union as he tried to carve out a greater role for Turkey in the Middle East.
But Turkey is a key ally for Washington which has often pointed to the country as a good example of a free-market democracy in the Muslim world, even though it has a poor record on freedom of expression.
Relations between Mr Erdogan and the Obama administration have deteriorated in recent years as Washington complained Ankara was not doing enough to fight Islamic State.
Mr Erdogan chafes at US support for Syrian Kurdish rebels, who have close ties to Kurdish guerrillas fighting in Turkey.
The State Department told US citizens in Turkey to "shelter in place and stay indoors".
Democratic presidential candidate Hillary Clinton said she supported Turkey's civilian government and was following the events in Turkey "with great concern".
European Council President Donald Tusk meanwhile called for a swift return to Turkey's constitutional order, saying tensions there could not be resolved by guns.
"Turkey is a key partner for the European Union. The EU fully supports the democratically elected government, the institutions of the country and the rule of law," he said at summit in Mongolia.
German Chancellor Angela Merkel echoed the sentiments.