BEIRUT Egypt's military wants to survive, not to be swept away in what looks like the imminent collapse of President Hosni Mubarak's ruling apparatus.
So will the generals hasten his exit as their Tunisian counter-parts did in persuading former President Zine al-Abidine Ben Ali to flee the country on January 14 after weeks of protests?
The armed forces' response to the earthquake of unrest shaking Egypt for the past six days has been ambivalent.
Troops now guard key installations after police lost control of the streets, but have neglected to enforce a curfew and have often fraternised with protesters, rather than confronting them.
Soldiers stood by tanks sprayed with slogans like "Down with Mubarak. Down with the despot. Down with the traitor. Pharaoh out of Egypt. Enough." Asked to explain, one soldier said: "These are written by the people. It's the views of the people."
Mubarak, clinging to power as his legitimacy vaporises, on Saturday named his intelligence chief, Omar Suleiman, a former military man, as vice-president, a post vacant for 30 years.
He also appointed former airforce commander Ahmed Shafiq as prime minister after sacking the entire cabinet.
But it remains to be seen whether the military men now in charge will keep the 82-year-old Mubarak in power, or decide he is a liability to Egypt's national interests -- and their own.
Paul Salem, director of the Carnegie Endowment's Middle East Centre in Beirut, noted that the "whole ship of state" foundered in earlier upheavals, such as the 1979 overthrow of Iran's shah or the ouster of Iraq's Saddam Hussein by U.S. invaders in 2003.
"Events in Tunisia have shown quite the opposite," he wrote in a commentary. "Indeed, the army realised that to save itself it had to send the ruler away rather than stand by him.
"The lesson that getting overly involved in politics might weaken military institutions rather than strengthen them is a lesson that was learned by most military establishments around the world in past decades -- including the Turkish military.
"We hope it is being learned among Arab military officials as well, particularly in Egypt," Salem wrote.
HEART OF POWER
Egypt's sprawling armed forces -- the world's 10th biggest and more than 468,000-strong -- have been at the heart of power since army officers staged the 1952 overthrow of the monarchy.
All four Egyptian presidents since then have come from the military, now led by Field Marshal Mohamed Hussein Tantawi, 75. It benefits from about $1.3 billion (£819 million) a year in U.S. military aid.
Egyptians tend to revere the military, less associated with daily repression than the police and security agencies, which leaked U.S. diplomatic cables say have grown into a vast force of 1.4 million since the failed Islamist revolt of the 1990s.
Yet the crowds flooding the streets clearly have no desire to see Mubarak's three decades of authoritarian rule replaced by a military line-up featuring his closest cronies.
Mubarak met his top commanders on Sunday, state television showed, in another indication that he sees the military as his only hope as the other pillars of his establishment crumble.
His widely discredited political machine, the National Democratic Party, symbolically went down in flames when demonstrators torched its Cairo headquarters on Friday.
A business elite, seen as the main beneficiary of Egypt's liberal economic reforms, can offer no bulwark against the outpouring of anger fuelled by the government's failure to listen to popular political, economic and social grievances.
NO SCRUTINY OF MILITARY
The military is notoriously opaque. Reporting on it remains taboo, even in the much more vibrant media scene that has blossomed in Egypt in recent years. Little is known about its substantial land holdings, huge economic interests or budget.
"The idea that the military remains a key political and economic force is conventional wisdom here," said a U.S. diplomatic cable from July 2009 released by WikiLeaks on Friday.
"However, other observers tell us that the military has grown less influential, more fractured and its leadership weaker in recent years," the cable from the U.S. embassy in Cairo said.
Nevertheless, the military may see its duty now as ensuring an orderly transition to an undefined new political order.
Among the many imponderables of the extraordinary turmoil is a possible disconnect between the generals in Mubarak's circle and the sentiments of the soldiers on the streets.
"It's one of those moments where, as with the fall of communism in Eastern Europe, it can come down to individual lieutenants and soldiers to decide whether they fire on the crowd or not," said Rosemary Hollis, Middle East expert at London's City University.
The army quelled bread riots in Egypt in 1977 and halted a rampage by policemen over pay in 1986, but the scale of the past week's uprising across the country dwarfs those events.
Until recently, most speculation about Egypt's military centred on its attitude to Mubarak's supposed -- and often denied -- ambitions to hand over the presidency to his son Gamal, a businessmen and politician with no military background.
Suleiman's appointment as vice-president and the manifest popular hostility to Gamal have put that question to bed.
Presidential elections are due in September, but many Egyptians are hoping the incumbent will be long gone by then.
"Mubarak, Mubarak, the plane awaits," protesters chanted.
(Editing by Matthew Jones)
Our top photos from the last 24 hours.