CAIRO // In the 10 months since they seized power, Egypt's generals have marketed themselves as the protectors of the revolution, guarantors of sovereignty and unwavering supporters of the "glorious" people of Egypt.
They remind everyone who cares to listen of their valour in the 1973 Arab-Israeli war, when Egyptian troops launched a surprise attack across the Suez Canal.
They play the patriotic card and accuse their critics of being the agents of foreign powers. But their behaviour, and the killing of protesters, since the popular uprising that forced Hosni Mubarak from power leave many sceptical that they will honour their promise to hand over power to civilians.
In the past two weeks, demonstrations became riots. At least 17 protesters were killed. A woman was half-stripped by security forces, dragged through the street and beaten, and the shocking images were beamed around the world.
Public fury has the members of the Supreme Council of the Armed Forces (Scaf) frantically struggling to come up with a safe exit that would guarantee immunity after they step down.
They also want to surrender power with the military's status as the country's most revered and powerful institution regained - not an easy task given recent events.
Many politicians across the broad political spectrum support giving them such guarantees, largely out of eagerness to see their backs after months of turmoil, bloodshed and worsening economic and security woes.
Others, mostly the protesters who toppled Mubarak in February, insist the generals face prosecution for killing demonstrators and for human-rights abuses.
Several rights groups are collecting evidence of what they say are crimes against humanity by the military to present to the world's war crimes tribunal, the International Criminal Court. Others are suing the generals in civil court, which is likely to create an avalanche of criminal cases.
The generals, meanwhile, are sending out signals in private they would consider stepping down ahead of schedule. Publicly, the military has said it plans to step down after presidential elections to be held before the end of June.
Elections are underway for a parliament, which would, at least in theory, write a new constitution and rule until a president is elected.
One option floated by politicians and activists is for the presidential election to be in January, with the new head of state to be sworn in on February 11, the anniversary of Mubarak's ouster - when the military is due to step down.
Another is for the newly elected parliament to appoint a national unity government in January to take power from the military until a presidential election is held by the end of June.
Deepening the generals' predicament were last week's images of army troops stomping on women protesters, including those wearing abayas. In the eyes of many, those images reduced the army to a band of thugs no better - or even worse - than Mubarak's hated police.
One image in particular - the one in which half a dozen soldiers stripped an abaya-wearing woman half naked as they dragged her on the ground and beat her with truncheons before one clumsily draped her abaya back over her - may well be one day credited as a main catalyst in forcing the military to step down.
It is certainly already a defining image of the fight against military rule.
Days before that, there were images of army troops urinating on protesters from the roofs of state buildings. Others showed them dropping rocks on protesters. One showed an army officer running towards the protesters while firing from a pistol, though it is not known if he was firing live rounds.
In perhaps the most significant protest since the anti-Mubarak uprising, about 10,000 women marched through central Cairo last week demanding the military step down immediately. Their unusually harsh chants berated the army and the generals.
The military quickly issued a statement expressing regret over the troops' behaviour and promised an investigation. But the generals did not apologise.
"Tantawi stripped your women naked, come join us," they chanted. Field Marshal Hussein Tantawi is the head of the military council and was Mubarak's defence minister for 20 years.
The march came as young demonstrators in Tahrir Square chanted increasingly bold slogans against the military. Unthinkable only months ago, they routinely swore at the military and called the soldiers cowards.
Cartoonists and columnists, meanwhile, have derided the military for killing unarmed protesters and beating women. Much of their ridicule focused on the generals' age, loyalty to Mubarak and routine references to a third party or "hidden hands" behind the violence.
One cartoon showed Martians landing on Earth to confess they were the third party.
Yesterday the judiciary distanced itself from the military. Women in military prisons have been tested for their virginity, although it is not clear what that involved or why they were tested. The Cairo Administrative court ordered the virginity tests must be stopped.
The case was filed by Samira Ibrahim, a woman who said the army forcefully tested her in April after she was arrested during a protest in Tahrir Square. Human rights organisations say there have been many other such tests by the military. Hundreds of people inside the courtroom cheered after the ruling was read out.
* Additional reporting by Reuters