ONE OF THE FEW things that has been clear about the tumultuous situation in Egypt this week is the plummeting prestige and influence of the United States. Anti-government demonstrators in Cairo’s Tahrir Square have been carrying placards and chanting slogans denouncing the U.S. ambassador; meanwhile senior government officials, anticipating a possible military coup, are already blaming the Obama administration for green-lighting it. A country that for decades has been the the United States’ closest Arab ally — and one of the largest recipients in the world of U.S. aid — appears united only in its disregard and contempt for Washington.

The Obama administration is not entirely responsible for this situation: In Egypt’s polarized and chaotic political environment, conspiracy theories and false perceptions of the United States have become commonplace. But the administration has helped to foster the growing anti-Americanism — if not the growing chaos in Egypt — through its mishandling of the Islamist government of Mohamed Morsi. For months, as the Morsi government has taken steps to consolidate power, quash critics and marginalize independent civil society groups, President Obama and his top aides have been largely silent in public. No effort was made to use the leverage of U.S. aid to compel a change of policy. Instead, the government was lauded for its help in preserving peace between Israel and the Palestinians, and U.S. policy focused on helping Egypt win aid from the International Monetary Fund.

An attempt by the ambassador in Cairo, Anne W. Patterson, to “set the record straight” in a public speech two weeks ago only exacerbated the problem. Ms. Patterson bluntly questioned the opposition’s strategy of attempting to organize a popular uprising to overthrow the government, saying “my government and I are deeply skeptical” that “street action will produce better results than elections.” She added: “Egypt needs stability to get its economic house in order.” That could have been an appropriate message if the ambassador balanced it by addressing with equal directness the government’s quasi-authoritarian measures, such as its plans to strip non-government organizations of funding or its attempts to impose one-sided election rules. But there was no mention of Mr. Morsi’s excesses.

On Monday, Mr. Obama belatedly called Mr. Morsi to say that “democracy is about more than elections” and encouraged him to be “responsive” to the opposition, according to a White House statement. He said publicly that the United States was not taking sides in the standoff. But while saying that “the current crisis can only be resolved through a political process,” the president and administration spokesmen did not take an unambiguous stand against a military coup.

This was another omission: The White House should make clear in its public statements as well as in private communications that Egypt’s armed forces will put U.S. military aid at risk if they remove a democratically-elected government by force or seek to reconstitute the autocratic regime that misruled Egypt until a year ago. A military takeover will not end Egypt’s political crisis, and the United States should neither be complicit in one, nor allow itself to be blamed for it.