LONDON -- Is the era of the military big man back? In Egypt, where Gen. Abdul-Fattah el-Sisi led a populist putsch against the elected president, prison doors are swinging.
Mohamed Morsi, the Muslim Brotherhood leader and freshly ousted president, languishes in one jail cell, while Hosni Mubarak, the despised autocrat who led Egypt for 30 years, has just been released from another.
The turmoil highlights the central role of the military in some postcolonial Muslim countries, where at least in the fitful early stages of democracy, it forcefully imposes itself as the self-appointed arbiter of power and the guardian of national identity.
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.
"General Sisi needs an exit plan, now," said Vali Nasr, the dean of the Johns Hopkins University's School of Advanced International Studies and a former senior State Department adviser. "Without one, he could end up like Musharraf. And his country, too, could be left worse off at the end of his military rule."
Military and civilian leaders have been competing for power in Turkey, Pakistan and Egypt for decades. The military has exercised muscular influence in all three countries, openly or behind the scenes, because of weak civilian rule that can be traced to the foundation of the states -- in some cases, in a bid to circumscribe Islamist influence.
Egypt's generals ousted the monarchy and established a republic in 1952. Turkey's first president, Mustafa Kemal Ataturk, a military revolutionary, led a fierce secularization drive in the 1920s. Pakistan's military helped unify the country after its traumatic partition from India in 1947, and quickly established itself as the strongest arm of a weak state.
Pakistani, Turkish and Egyptian generals profess to love democracy, but they practice it with varying degrees of reluctance. After seizing power in Pakistan in 1999, General Musharraf promised early elections but stayed for nine years. During a stint at the United States Army War College in 2005, General Sisi wrote a paper titled "Democracy in the Middle East" that was critical of American intervention in the region. Turkey's army has claimed a popular mandate for inherently undemocratic acts.
Instead, the military has deeply embedded itself in each state's DNA, winning privileges and lucrative jobs for its officers, all the while controlling politics in blunt fashion. Pakistan's generals have mounted four coups over the past 55 years; Turkey has had three. In both Pakistan and Egypt, analysts describe the military as the core of the "deep state."
"The military has been very influential since the 1952 revolution," said Hala Mustafa, editor of the Journal of Democracy in Cairo. "Even under Morsi, it had the same privileges and status as it had over the past six decades."
How the militaries exercised that influence has varied. While Turkish and Egyptian generals ruthlessly marginalized political Islamists, Pakistan's men in uniform co-opted them. During the 1980s, Gen. Mohammad Zia ul-Haq of Pakistan used them to both fight and to Islamize Pakistan's national identity, a source of tension with Egypt at the time.
In all three countries, Islam is often seen as the boogeyman of democracy, Dr. Nasr said. "But that is wrong. The real struggle in the Middle East is between civilian rule and the military."
That struggle is further complicated by the debate over how to integrate Islam into politics. For years, Turkey was the model of progress for many Muslim countries. But the military's retreat has been driven, in part, by the country's desire to join the European Union. And the gloss of civilian rule vanished in June when Prime Minister Recep Tayyip Erdogan violently suppressed a protest movement in central Istanbul, suggesting that one authoritarianism was being replaced with another. This month's treason trial brought out sharp divisions between secularists and Islamists, underscoring how Turkey's nation-building model remains a work in progress.
Yet the Turkish model may still offer the best hope: the protests in Istanbul appeared aimed more at Mr. Erdogan's hard-nosed policies than at the system of civilian rule itself.
For some Egyptians pondering their future, the dreaded outcome is to become like Pakistan. Yet there are lessons to be learned. For decades, Pakistani generals could intervene in politics at will, a fact that the current prime minister, Nawaz Sharif, appreciates better than most: his last stint in power ended in 1999 with an army coup.
But since General Musharraf was ousted as president in 2008, Pakistan's notoriously fractious politicians joined hands to give the military little room for maneuver, culminating in the recent, relatively clean election, which Mr. Sharif won with a handsome mandate. The courts have also grown bolder, highlighting military-driven vote rigging and human rights abuses (even if nobody has yet faced charges) and daring to indict General Musharraf, who also faces possible treason charges.
Pakistanis now view themselves as exemplars of transition politics. After Mr. Morsi's ouster, which many Egyptian liberals supported, their Pakistani counterparts were quick to offer advice on the perils of military intervention. "Been there, done that -- and it was definitely the wrong choice," said the journalist Omar R. Quraishi on Twitter.
Still, Pakistan's generals remain strong behind the scenes, and Pakistan's transition is far from complete. General Musharraf's trial, analysts say, could offer a weather vane of how much prestige they are willing to cede.
Leaders in Pakistan, Turkey and Egypt are acutely aware of the parallels among them. General Musharraf, who speaks Turkish, used to wax lyrical about the secular vision of Turkey's founder, Mr. Ataturk. More recently Turkish leaders have expressed fear that events in Egypt could stir trouble in their own country. "At moments of peril, it is more important than ever to stick closely to the democratic path," President Abdullah Gul wrote recently in The Financial Times.
Yet as all three countries climb the ladder toward functioning democracies, the effort is complicated by outside pressure, which often favors the military. American support for Pakistan and Egypt has long been predicated on those countries' geostrategic value: Egypt's proximity to Israel and Pakistan's to Afghanistan. Turkey is a major player in NATO.
And in Egypt, General Sisi and his commanders have drawn vocal support for his harsh crackdown on the Muslim Brotherhood from the governments of Israel and Saudi Arabia. Even Mr. Mubarak, at the height of his 30-year rule, dared not operate so boldly. But therein lies the danger, perhaps, for General Sisi.
His support from Egyptian civic society could evaporate as revulsion grows at the bloodshed against Islamists and the military's crackdown on other dissenters. If he alienates Western support, financing from the Middle East cannot sustain his country for very long. And, as events in Turkey and Pakistan have shown, the military's eminence can endure only by strategically ceding space to civilian players -- or the use of violent repression.
This article originally appeared in The New York Times.