But a look at other Muslim countries that have struggled with democratic transitions, including two other polestars of the Muslim world, Pakistan and Turkey, should provide a kind of warning to General Sisi. There it is the generals who are now facing charges.

Last week, a Pakistani court indicted the former military leader Gen. Pervez Musharraf in the assassination of former Prime Minister Benazir Bhutto — the first time in Pakistan’s coup-strewn history that a leading general has faced criminal prosecution. In Turkey, a court recently imprisoned dozens of senior military officers on charges of plotting to overthrow the government, a punitive reminder to a military once accustomed to reasserting its authority through coups.

Though General Sisi is riding a wave of popularity among some Egyptians and neighboring countries, notably Saudi Arabia and Israel, for cracking down on Islamists, the events in Turkey and Pakistan have shown the limits of military power. And in Egypt, that may ultimately mean allowing the Islamists a genuine role in public life.