President Barack Obama called on all parties to "support the democratically elected government of Turkey" on Friday after an attempted military coup in the country, a strategically located but fickle NATO ally whose cooperation is crucial to defeating the Islamic State terrorist network.

Obama's view was announced in a readout of his call with Secretary of State John Kerry.


"The president and secretary agreed that all parties in Turkey should support the democratically-elected government of Turkey, show restraint, and avoid any violence or bloodshed. The secretary underscored that the State Department will continue to focus on the safety and security of U.S. citizens in Turkey," the White House statement said.

Kerry, in a statement of his own, said he had spoken to Turkey's foreign minister "and emphasized the United States’ absolute support for Turkey’s democratically-elected, civilian government and democratic institutions." NATO took a similar line, with the alliance's General Secretary Jens Stoltenberg calling for "full respect" for Turkey’s democratic institutions.

Former Secretary of State Hillary Clinton issued a carefully calibrated statement that called for "calm and respect for laws, institutions, and basic human rights and freedoms," while urging "support for the democratically elected civilian government." Her Republican opponent, Donald Trump, remained silent as of 9:30 p.m. ET.

The dramatic events in Turkey, a longtime strategic partner of the United States that houses a vital U.S. airbase and a small U.S. arsenal of tactical nuclear weapons, appeared to catch administration officials by surprise on Friday evening. The fluid situation could prove complicated for Obama, who embraced Turkish President Recep Tayyip Erdogan as a moderate Muslim democrat early in his tenure, but has grown disillusioned as the Islamist leader has consolidated power.

The State Department warned Americans in Turkey to "shelter in place" and confirmed that martial law had been imposed in the country. Pentagon officials are "monitoring the situation in Turkey closely and are taking appropriate steps to ensure the safety and security of our service members, civilians, their families, and our facilities,” a defense official said.

Just who was in charge of the country was not entirely clear as Erdogan, who was on vacation in the Turkish coastal town of Marmaris, landed at Istanbul's Ataturk Airport, where he was greeted by throngs of supporters. A spokesman for Turkey's national intelligence service said the coup attempt had been "repelled." Turkish officials in Turkey and at the embassy in Washington did not respond to phone calls Friday.

Erdogan's triumphant return came after the Turkish military claimed to have “completely taken over the administration of the country to reinstate constitutional order, human rights and freedoms, the rule of law and general security that was damaged."

Earlier Friday, as tanks took to the streets of Istanbul and the capital Ankara, Turkish Prime Minister Binali Yildirim said “some people illegally undertook an illegal action outside of the chain of command.”

Meanwhile Erdogan, who was outside the country as the attempted military takeover began, took to FaceTime to urge people to "gather at public squares and airports" to denounce the attempted coup. He described the military action as "an attempt at an uprising by a minority within our armed forces."

Erdogan has been in power in Turkey for more than a decade, either as president or prime minister. A dominating, suffocating presence in Turkish politics, he has survived mass protests, a renewed Kurdish insurgency in the country's southeast and massive blowback from his intervention in the Syrian civil war next door.

Obama's swift decision to back Erdogan against the coup plotters comes despite his concern at the Islamist leader's growing intolerance for dissent. In April, the U.S. president pointedly snubbed Erdogan during his five-day trip to Washington for the Nuclear Security Summit, and described his escalating crackdown on the Turkish media as "troubling."

"He came into office with a promise of democracy and Turkey has historically been a country in which deep Islamic faith has lived side-by-side with modernity and an increasing openness, and that’s the legacy he should pursue," Obama said at the time, warning his Turkish counterpart against "repression of information and shutting down democratic debate."

Erdogan fired back in a gaggle with Turkish reporters. "I was saddened to hear that statement made behind my back. During my talk with Obama, those issues did not come up," he said, referring to a brief meeting the two leaders held on the sidelines of the summit.

"You cannot consider insults and threats press freedom or criticism," Erdogan said.

Even as Turkey has faced growing domestic turmoil, with a number of lethal terrorist attacks and political tensions bubbling below the surface, it had remained a relatively stable country in a volatile Middle East, and recently restored normal relations with Israel with U.S. encouragement.

Turkey also has been a major refuge for Syrians trying to flee the violence in the their country, and the European Union has been trying to work with it to stem the flow of refugees heading for continental Europe.

The situation in Turkey Friday bore echoes of the dilemmas Obama faced in another key U.S. ally in the Middle East: Egypt.

In 2013, the Egyptian military threw out the highly unpopular but democratically elected Islamist President Mohamed Morsi. The Obama administration, believing Egypt to be a critical partner in an unstable region, declined to even say whether the events constituted a coup or not. Had it called the takeover a coup, the administration would have had to cut off aid to the country under U.S. law.

Turkey receives little to no direct U.S. military aid, experts noted. However, it is the only Muslim country in NATO and has been a staunch military ally of the United States since it joined the Western alliance in 1952.

A key NATO base is located at Incirlik in southern Turkey, which is now being used to launch attacks against the Islamic State in neighboring Syria.

The defense official said: "As of this time, there has been no impact to Incirlik Air Base and counter-ISIL air operations from Incirlik continue."

But experts expressed concern for how the turmoil could affect the air war against the Islamic State, which the Obama administration claims has greatly reduced the group’s reach and effectiveness.

“It will considerably complicate U.S. efforts to coordinate with Turkey in fighting ISIS, and lingering instability, anger and hostility toward the United States would further sabotage efforts moving forward," said Blaise Misztal, national security director at the Bipartisan Policy Center.

The Incirlik base is also home to a U.S. and NATO early warning missile defense radar, as well as an estimated 60 to 70 U.S. tactical nuclear weapons, according to the Nuclear Threat Initiative, a research and advocacy group.

There are also more than a dozen installations large and small spread across the country that house U.S. or NATO personnel — from Istanbul in the northwest to Dyarbakir in the southeast. Turkey also has more than 500 soldiers serving as part of the NATO force in Afghanistan.

The country’s strategic importance -- position as it is on the fault line between two continents, Europe and Asia -- has increased over the years as U.S. involvement in the broader Middle East has deepened, and as new sources of natural gas have emerged in Central Asia.

Turkey also controls access to and from the Black Sea. It also remains one of the largest customers for American weapons, including as a partner in the new F-35 fighter jet.

“From the U.S. perspective, the worst-case scenario might be an ineffective coup that pitches Turkey into a prolonged power struggle" said Misztal. “Even a quickly executed coup which met with little resistance would be destabilizing, but a partial or unsuccessful coup would lead to much more instability ahead.”

The Associated Press contributed to this report.