CAIRO A decision by Egypt's supreme court to overrule the president when he recalled parliament has raised the stakes in the power struggle between the long-repressed Muslim Brotherhood and the military which ruled for decades.
Hours after the Islamist-led parliament met on Tuesday in open defiance of the generals who had ordered it dissolved last month, the court halted President Mohamed Mursi's decree to reconvene the assembly.
The court ruling highlights the scale of the conflict ahead for Mursi's Brotherhood. The group is battling to wrest power not only from military men who ruled Egypt for six decades until Mursi took office on June 30, but also an establishment built up under their rule that long worked to sideline Islamists.
For many Egyptians, though, the power struggle is only extending turmoil that has plagued the nation since Hosni Mubarak was toppled by mass protests in February 2011, sending the economy into a slump and tipping many deeper into poverty.
"Battle for power goes ahead on the judicial front," read Al Watan newspaper's headline, emphasising how the transition has become mired in court wrangles challenging everything from Mursi's decree to the make-up of a body set up to write a new constitution.
But it is an uneven fight, according to senior Brotherhood official Mahmoud Ghozlan speaking shortly after Tuesday's ruling, who accused the army of using the Supreme Constitutional Court against the country's first freely elected leader.
"It is part of a power struggle between the military council and the president who represents the people and in which the military council is using the law and the judiciary to impose its will," he said.
Having handed over executive office to Mursi, the army has fewer tools to defend its privileges and status. But Western diplomats say it can still rely on a judiciary where there remains a streak of anti-Islamist sentiment.
Yet, like the rest of Egypt, the judiciary is divided.
Judges clubs in Cairo and Alexandria have demanded Mursi accept the court's ruling, arguing his decree defied the basic tenets of Egyptian law.
But Ahmed Mekki, deputy head of Egypt's highest appeals court, came out on television and radio talk shows to back him. "Mursi's decision has legal grounds," he said on one.
The military sought to rein in the president's powers in a last-minute decree on June 17, just as the presidential vote closed. It stripped the presidency of the title armed forces commander and gave itself legislative powers after dissolving parliament, in line with the initial supreme court ruling.
But barely a week into office, the president called parliament to reconvene. The first session was held on Tuesday under the parliament speaker, another Brotherhood man Saad al-Katatni. The Brotherhood's party controls the biggest bloc in parliament.
The Brotherhood argued it was not challenging the judicial ruling that declared the assembly void, but believed parliament should be allowed to sit until elections are held once the new constitution is written.
"Each one is trying to use the law to consolidate its position, but the real confrontation is a political one," said Hassan Nafaa, a political analyst.
The Brotherhood also faces a divided nation. The group has angered many liberals and other rivals with what they see as an Islamist power grab, demonstrated, they say, in the Brotherhood's decision to run for president after first saying it would not.
Some accuse Mursi of riding roughshod over the judiciary by ordering parliament to convene.
Leftist Hamdeen Sabahy, a rival presidential contender, urged Mursi to respect the constitutional court ruling to help "exit the current crisis facing the country." But he also called for the army to give legislative powers to a separate body.
Although many were surprised at how swiftly Mursi acted to defy the military, few are in doubt that Islamists have a long war of attrition on their hands to roll back the army and reform an establishment packed with Mubarak-era officials.
Turkey is the closest regional example where such a struggle has taken years. The powerful army there has gradually been rolled back by the AK Party, which has Islamist roots.
Turkish Prime Minister Tayyip Erdogan said on Wednesday Egypt's military council was "ignoring the power of the people and by not accepting the current parliament, it is a real affront to the power of the people.
"We believe in our hearts that President Mursi will overcome this difficult and arduous period through consultation, dialogue and calm."
(Additional reporting by Shaimaa Fayed and Dina Zayed; Writing by Edmund Blair; Editing by Janet Lawrence)