Egypt's highest court today ordered the country's Islamist-dominated parliament dissolved and ruled that the last prime minister to serve under Hosni Mubarak could stay in the presidential race.
The decisions come as twin blows to the Muslim Brotherhood that could sweep away its political gains since Mubarak's removal 16 months ago.
The ruling means that new elections will have to be held to form a new parliament.
The rulings by the Supreme Constitutional Court, whose judges are Mubarak appointees, escalated the power struggle between the Brotherhood and the military, which stepped in to rule after Mubarak's fall.
The decisions tip the contest dramatically in favour of the ruling generals, robbing the Brotherhood of its power base in parliament and boosting Ahmad Shafiq, the former Mubarak prime minister who many see as the military's favourite in the presidential contest against the Brotherhood's candidate.
Senior Muslim Brotherhood leader and MP Mohammed el-Beltagy said the rulings amounted to a "full-fledged coup."
"This is the Egypt that Shafiq and the military council want and which I will not accept no matter how dear the price is," he wrote on his Facebook page.
The Brotherhood and liberal and leftist activists who backed last year's revolution against Mubarak accused the military of using the constitutional court as a proxy to preserve the hold of the ousted leader's authoritarian regime and the generals over the country. Many of them were vowing new street protests.
In the last election, held over three months starting in November, the Brotherhood came out the big winners, grabbing nearly half the seats. Ultra-conservative Islamists known as Salafis won another 20%. In the months that followed, the Brotherhood tried to translate those gains into governing power but was repeatedly stymied by the military's grip.
On Saturday and Sunday, Shafiq goes head-to-head against the Brotherhood's candidate, Mohammed Morsi, in the presidential run-off. The race has already deeply polarised the country. The anti-Shafiq camp views him as an extension of Mubarak's authoritarian regime. The anti-Morsi camp fears he and the Brotherhood will turn Egypt into an Islamic state and curtail freedoms if he wins.
In its decisions today, the Supreme Constitutional Court ruled that a third of the legislature was elected illegally. As a result, it says in its explanation of the ruling, "the makeup of the entire chamber is illegal and, consequently, it does not legally stand."
The law governing the parliamentary elections was ruled unconstitutional by a lower court because it breached the principle of equality when it allowed party members to contest a third of seats set aside for independents. The remaining two thirds were contested by party slates.
In a separate ruling, the court said Shafiq could stay in the presidential race, rejecting a law passed by parliament last month that barred prominent figures from the old regime from running for office.
Defenders of the law argued that after a revolution aimed at removing Mubarak's rule, parliament had a right to prevent regime members from returning to power. Opponents of the law called it political revenge targeting Shafiq.
The court said the law was not based on "objective grounds" and was discriminatory, violating "the principle of equality."
"This historic ruling sends the message that the era of score-settling and tailor-made law is over," a vigorous Shafiq told supporters gathered in a rally.
The rulings throw Egypt deeper into uncertainty and threaten more instability after more than a year of tumultuous transition under the military's rule.
Throughout, opponents of the military have accused it of seeking to preserve its influence over politics even after its promised handover of power to the elected president by July 1. They also believe it wants to largely keep the bases of Mubarak's rule in place, including many figures from his now dissolved ruling party.
At the same time, there has been widespread public dissatisfaction with the Islamist-led parliament, which many criticised as ineffective.
The Brotherhood's popularity had declined since the legislative elections because of moves that critics saw as attempts to monopolise the political scene and advance its own power. It angered liberals, leftists and secular Egyptians when it and other Islamists tried to dominate a parliament-created panel tasked with writing the next constitution. The panel was dissolved by court order, and a new one had yet to be appointed.
The dissolution of parliament now raises the possibility the military council could appoint the panel, a step that would fuel accusations that it is hijacking the process.
The legal adviser of the Freedom and Justice Party, the Brotherhood's political arm, said the court rulings were "political," lamenting the outgoing legislature as the country's "only legitimate and elected body."
"They are hoping to hand it over to Ahmed Shafiq and make him the only legal authority in the absence of parliament. The people will not accept this and we will isolate the toppled regime," Mukhtar el-Ashry said in a posting on the party's website.
A moderate Islamist and a former presidential candidate, Abdel-Moneim Abolfotoh, said the rulings amounted to a "coup" and warned that the youth, pro-democracy groups that engineered the uprising that toppled Mubarak last year would protest the court's rulings.
"Those who believe that the millions of young people will let this pass are fooling themselves," he wrote on his Twitter account.