WASHINGTON • With all the crises in the Middle East, the Obama administration took solace in the fact that there was one reliable, democratically elected strongman - a stalwart member of Nato - that Washington could depend on: President Recep Tayyip Erdogan of Turkey.
No matter how the coup attempt against Mr Erdogan plays out over the next hours and days, that certainty has been shattered.
Until mid-afternoon last Friday, US officials thought Mr Erdogan had tightened his iron grip on his country. He had purged the judiciary, jailed insouciant senior military officers three years ago and installed seemingly compliant successors, and cracked down on the opposition and the news media.
As one senior US diplomat said, no one had come to work that day at the White House, the State Department or the CIA expecting to see Mr Erdogan turn to FaceTime on his iPhone to plead with the Turkish people to take to the streets in his defence.
The country suddenly became another tumultuous one in a region that knows no end of turmoil.
Mr Erdogan would almost certainly have to begin a purge of the plotters and probably hunt for other challengers to his authority - extending a streak of ruthlessness that has left many of his Nato allies gasping.
Friday's events could leave in limbo some of the top priorities of the United States and Europe.
They rely on Turkey to help battle the Islamic State in Iraq and Syria (ISIS), to contain the flow of migrants out of Syria and to host US intelligence agencies and Nato forces seeking to grapple with upheaval in the Middle East.
The coup attempt "presents a dilemma to the US and European governments: Do you support a non-democratic coup or an increasingly non-democratic leader?" said Mr Richard Haass, president of the Council on Foreign Relations.
To many in Washington, that dilemma is secondary to the question of whether Turkey will be a reliable partner in the battle against ISIS, a willing host to US forces and a stable player in the world's most volatile corner.
US officials said the next 24 to 48 hours would be crucial in determining whether the coup attempt had lasting repercussions.
Unlike past bloodless coups in Turkey, this one did not have the implicitly understood support of the public, which appeared to be split over the military intervention.
"The danger here is this could spiral out of control and turn into a full-blown civil war," Mr Eric Edelman, a former US ambassador to Turkey and former leading Pentagon official under president George W. Bush, said on Friday.
Europeans would have plenty to worry about: Just a few months ago, they struck a deal with Mr Erdogan, paying Turkey more than US$6 billion (S$8 billion) to hold on to Syrian migrants rather than let them flow into Western Europe.
It was the migrant crisis more than anything else, the Europeans believe, that led to Britain's decision to exit the European Union. A failure to stem the flow, they fear, could lead to the break-up of Europe - a fear that US officials, led by Secretary of State John Kerry, shares.
Washington has had its own problems with Mr Erdogan, who came to power in 2003 as a seeming reformist, and the cross-currents of Turkish politics.
Any prolonged instability in Turkey could impede Mr Kerry's latest effort to bring a ceasefire to Syria and perhaps threaten the US ability to operate from the major air base at Incirlik, where many of the operations against ISIS are launched.
NEW YORK TIMES