Over the past two years, post-revolution Egypt has been a policy minefield for the Obama administration, which has struggled to balance its support for a democratic transition with its need to preserve its interests in the region.

The latest chapter of Egypt’s fraught political transition, however, has left the administration in perhaps its most precarious position yet.

As Egyptian President Mohamed Morsi weathers a storm of opposition that could pave the way for a military coup, Washington and its ambassador in Cairo have emerged as lightning rods. Those calling for the dismissal of Morsi say the United States became too cozy with the Muslim Brotherhood, the political and social movement that brought the Islamist leader to power. The Brotherhood, meanwhile, warns that the United States is failing to speak out loudly and clearly against a military coup in the making.

After voicing support for Morsi, the Obama administration appeared to distance itself from him this week, with the White House issuing a statement saying that President Obama had told the embattled Egyptian leader in a phone call that the United States “does not support any single party or group.”

Analysts say that shift appeared calibrated for the prospect that Morsi could be ousted in the coming days.

“The U.S. is hedging its bets in the typical fashion of this administration,” said Shadi Hamid, an Egypt expert at the Brookings Doha Center. “They don’t want to take a stand one way or another.”

As they have for much of the past two years, events in Cairo were unfolding at a dizzying pace Tuesday. Street protests turned violent on the eve of a deadline the Egyptian military set for the president and the opposition to strike a compromise. Failure to do so, the generals warned, would force the army back into the position of governing a country grappling with political unrest and a failing economy.

U.S. officials are watching the crisis with growing concern but appear disinclined to be seen as protagonists.

“Washington is trying to walk a very fine line on engaging with political and military leaders,” said a senior U.S. official, speaking on the condition of anonymity to explain the administration’s calculus. “No one is eager to demonstrate a strong U.S. hand in the midst of a very fluid crisis.”

That posture is probably shaped in part by the recognition of how polarizing the U.S. ambassador in Cairo became in recent weeks after making a series of pointed remarks about domestic Egyptian politics. Anne Patterson, who has served as the envoy to El Salvador, Colombia and Pakistan over the course of four decades, has been lampooned as an apologist for Morsi. Demonstrators opposed to Morsi have waved unflattering, and at times crude, placards bearing her photo, demanding that she leave Egypt.

Anti-American rhetoric in the country has ebbed and flowed since President Hosni Mubarak was ousted in February 2011. It soared in recent days, however, as critics of Morsi blasted Patterson for a June 18 speech that many saw as a full-throated endorsement of him.

In her most detailed remarks about the U.S. relationship with the Muslim Brotherhood — a group with a militant past and conservative social views — Patterson said Washington had sought to build a constructive relationship with legitimately elected leaders.

“Some say that street action will produce better results than elections,” she said. “To be honest, my government and I are deeply skeptical. Egypt needs stability to get its economic house in order, and more violence on the streets will do little more than add new names to the lists of martyrs.”

In April, she pushed back on the idea that the military — a secular institution revered by most Egyptians — should once again play a more active role in running the country. The generals oversaw Egypt until Morsi’s election last summer.

“Let me be clear: a military intervention is not the answer, as some would claim,” Patterson said, according to a transcript of the April 28 speech posted on the Web site of the U.S. Embassy in Cairo. “Neither the Egyptian military nor the Egyptian people will accept it as an outcome.”

Michele Dunne, the director of the Atlantic Council’s Rafik Hariri Center for the Middle East, said Patterson may have erred in speaking too bluntly.

“It was probably a mistake for her to comment in such detail on domestic Egyptian politics at a time when things were blowing up,” said Dunne, who previously served as a senior State Department and White House official. “But her intention was not to influence Egyptian politics.”

The bigger problem, Dunne said, is that Washington has failed to fundamentally reset its relationship with Egypt. It has continued to provide an annual $1.3 billion in military aid but has not reconfigured its civilian aid package or help jump-start the country’s economy by steering through a loan from the International Monetary Fund.

“They, in effect, have replicated the U.S. relationship with Mubarak,” said Dunne, suggesting that American officials have focused their efforts on influencing Morsi and his small circle of advisers.

U.S. interests in Egypt include its adherence to a peace treaty with neighboring Israel, access to the Suez Canal and cooperation on counterterrorism efforts.

On Tuesday, officials in Washington issued carefully parsed statements. A day after Obama urged Morsi to be responsive to the masses of protesters in Cairo, Secretary of State John F. Kerry delivered a similar message in a phone call to his Egyptian counterpart, Mohammed Kamel Amr. Kerry exhorted Amr to “listen to the Egyptian people,” State Department spokeswoman Jennifer Psaki said. Amid reports that Amr had resigned Tuesday, however, it was unclear whether the demand carried much weight.

Gen. Martin Dempsey, the chairman of the Joint Chiefs of Staff, called his counterpart in Cairo on Monday to discuss the situation. A spokesman for Dempsey offered no insights into the conversation and declined to say whether the Pentagon has counseled the Egyptian military against a coup.

Joby Warrick contributed to this report.