A YEAR ago, when Egypt’s nascent experiment in democracy led to the election of Mohamed Morsi of the Muslim Brotherhood as president, then-Secretary of State Hillary Rodham Clinton visited Cairo. Despite the tensions and fragility of institutions, she declared, “There can be no going back on the democratic transition called for by the Egyptian people.” She added, “They’re doing something they’ve never done in 5,000-plus years of history. They have had ­elections.”

In the year that followed, Mr. Morsi was hardly a paragon of democracy; his government mismanaged the country, the economy was in a tailspin and millions of people were disenchanted with his rule. But he was the elected president. In recent weeks, as protests swelled, he was abruptly removed from power by the Egyptian military, jailed and accused of high crimes. It was a coup. Mr. Morsi’s backers rightly feel they have been robbed, and the interim government is showing little sign of compromise or negotiation.

On Thursday, while in Pakistan, Secretary of State John F. Kerry was asked in an interview how the United States — a champion of democracy around the world — can justify supporting Egypt’s military crackdown. Mr. Kerry’s reply was inexplicable. He said, “The military was asked to intervene by millions and millions of people, all of whom were afraid of a descendance into chaos, into violence. And the military did not take over, to the best of our judgment so far. To run the country, there’s a civilian government. In effect, they were restoring democracy.”

It is one thing to be cautious and avoid using the word “coup,” which could trigger a cutoff of Egypt’s $1.5 billion annual U.S. aid package. But it is quite another to assert that Egypt’s military is “restoring democracy” when it has just removed an elected president from power.

The White House tells us that the secretary’s statement did not reflect the president’s policy. Good thing, because Mr. Kerry’s remark was careless and dangerous. No doubt, it will be taken as a vote of confidence by Defense Minister Gen. Abdel Fatah al-Sissi and encourage the military to press a campaign of violence and repression against the Muslim Brotherhood. The crackdown has already resulted in hundreds of deaths in clashes between the security forces and protesters, and street tensions are running high.

Even more damaging, Mr. Kerry’s statement will suggest to Muslims everywhere that democracy can be a card trick: Now you see it, now you don’t. The United States has invested great amounts of time and effort to persuade Muslims that democracy is the paramount system for representing and balancing all views in a society, rising above arbitrary and authoritarian rule. Mr. Kerry’s remark will be taken as proof that America likes democracy only when its friends are in power. That’s the worst possible message. It now becomes even more urgent for the secretary and the president to speak out for real democracy in Egypt, one that includes rather than persecutes the Muslim Brotherhood and Mr. Morsi. Last year, Ms. Clinton was right to insist there can be no going back on democracy. It is no less true today.