Many in the opposition, on the other hand, believe fiercely in minority rights, personal freedoms, civil liberties and electoral coalition-building — as long as the elections keep Islamists out of power. In other words, they are liberal without being democrats; they are clamoring fervently for Mr. Morsi’s ouster and want the military to intervene. But they have proved themselves woefully unequipped to organize voters. Though my heart is with their democratic goals, I must admit that their commitment to democratic principles runs skin deep.

So today, Egypt faces a disturbing paradox: an ostensibly democratic movement is calling on the military, which produced six decades of autocrats, to oust a democratically elected president — all in the name of setting the country, once again, on a path to democracy.

Since Mr. Mubarak was ousted, I have visited Egypt a half-dozen times to study the course of democracy there, most recently in March. I can attest that a year ago, most Egyptians were eager to see the generals leave the scene. Indeed, Mr. Morsi’s most popular act remains his firing of the defense minister and the military’s chief of staff last August. Strikingly, the general whom Mr. Morsi installed as defense minister, Abdul-Fattah el-Sisi, now seems to hold the fate of Mr. Morsi in his hands.

Mr. Mubarak ruled through fraudulent elections, with the support of Egypt’s security forces, crony capitalists and the United States and other powers. Mr. Morsi is something else entirely: Egypt’s democratically elected president.

Still, he has been a disastrous leader: divisive, incompetent, heavy-handed and deaf to wide segments of Egyptian society who do not share his Islamist vision. He and his Brotherhood backers have focused on consolidating power rather than delivering on his promises — to represent all Egyptians; to fix the economy; to make the streets safer, cleaner, less traffic-choked; to treat all Egyptians equally. None have been kept.