THERE IS no ambiguity about what happened in Egypt on Wednesday: a military coup against a democratically elected government and the wrong response to the country’s problems. The armed forces forcibly removed and arrested President Mohamad Morsi, who won 51 percent of the vote in a free and fair election little more than a year ago. A constitution ratified by a two-thirds majority in another popular vote last December was suspended; dozens of leaders of the Muslim Brotherhood have been arrested and a number of media outlets shut down. A little-known judge appointed as president and granted the power to rule by decree will be entirely dependent on the armed forces for his authority.

Having not spoken up against the excesses of Mr. Morsi’s government, the Obama administration has, with equal fecklessness, failed to forthrightly oppose the military intervention. But there should be no question that under a law passed by Congress, U.S. aid to Egypt — including the $1.3 billion annual grant to the military — must be suspended.

Some in the administration and Congress will try to avoid this step, because of the armed forces’ history as a U.S. ally and guarantor of peace with Israel. But the suspension of aid is the necessary first step in a U.S. policy that advances the aim Mr. Obama laid out in a Wednesday night statement: “to ensure the lasting restoration of Egypt’s democracy.”

Following the removal from office of Hosni Mubarak in February 2011, military leaders promised — as they did again Wednesday — to ensure democratic rights and quickly move toward elections. They did neither. Liberal democratic leaders who had opposed Mr. Mubarak’s autocracy were singled out for repression; critical journalists and activists were prosecuted and jailed in military-run trials; and while elections were repeatedly postponed, a campaign was launched against civil society groups dedicated to promoting free elections and human rights, culminating in the arrest and prosecution of the staff of several U.S. nongovernmental organizations. The generals, meanwhile, insisted on constitutional provisions exempting the armed forces and its budget from civilian authority.

The Obama administration should now make clear to the new military-backed regime that aid will be restored only if a genuinely democratic transition is pursued in the coming months. That means tolerance for all peaceful political forces, including the Muslim Brotherhood — whose leaders, including Mr. Morsi, should be immediately released. It means acceptance of free assembly and free media, including the Islamist broadcasters that have been shut down. Any changes to the constitution should be the result of a consensus among all political forces, without diktats by the military. And there must be a firm — and short — timetable for new parliamentary and presidential elections.

Had the armed forces not intervened, democracy probably would have led to the defeat within months of the Muslim Brotherhood in legislative elections. If it does not provoke the eruption of violent conflict, this coup may well ensure that Islamist forces, including more radical groups, grow stronger. The United States must focus on preventing the worst outcomes in a vital Arab ally, including civil war or a new dictatorship. That means dropping its passivity and using the leverage of aid to insist on a democratic transition.