Egypt's military rulers seized broad legislative powers after the country's supreme constitutional court dissolved both chambers of the country's first democratically elected parliament on Thursday in what analysts and critics said amounted to a coup d"état. The move came after the constitutional court ruled that a third of seats in the lower house were invalid, plunging the country into into deep political uncertainty two days before presidential elections. It in effect cancels an Islamist-dominated parliament assembled painstakingly over months of elections and hailed as a triumph of democracy by the international community. "The supreme court's decision is a full-scale coup," Mohamed Beltagy, a top official of the Muslim Brotherhood, declared in a statement broadcast on state television. This weekend's run-off pits Ahmed Shafiq, a stalwart of the ousted regime of Hosni Mubarak, against Mohamed Morsi, an Islamist party leader despised by Egypt's old guard. The ruling, promptly enacted by the Supreme Council of the Armed Forces - which has run the country since Mr Mubarak was overthrown - means that whoever wins that election will have no legislative body with which to work. It also annuls a 100-member assembly formed by lawmakers to draw up a new constitution that would define the president's powers. In a separate decision, the court also affirmed the rejection of a law passed by the Islamist-dominated parliament that would have barred former ranking officials of the Mubarak regime from running for higher office. This upheld the candidacy of Mr Shafiq, a former cabinet minister and premier, who is running against Mr Morsi, of the Muslim Brotherhood, in this weekend's election. The rulings - made by a judicial panel featuring several Mubarak appointees - sparked fears of a military-led counter-revolution. The court that ruled to dissolve Egypt's parliament is the highest in the country and decides whether legislation complies with constitutional principles. It has often been called on to pronounce on politically sensitive issues, including the legitimacy of electoral rules or whether laws comply with constitutional provisions derived from Islamic law, which is one of the main sources of legislation. The constitutional court used to have a reputation for independence. It has ordered the dissolution of parliament twice in recent decades because members had been elected under rules deemed to breach constitutional principles of fairness. However, in recent years that reputation was sullied. Some judges tried repeatedly under Hosni Mubarak to rid the courts of state interference but critics allege the former president took greater control of the court through his selection of senior judges loyal to him. This interference was seen as part of preparations to ensure that Gamal, his son, could succeed him as president. Gamal Eid, a human rights lawyer, said the president is empowered to appoint judges to the court, subject to criteria of seniority and had some leeway whom to choose. He said in recent years "political considerations tended to overshadow constitutional principles in the court's rulings." "They [the military] are deluding themselves if they think the youth will let this pass," Abdel Moneim Aboul Fotouh, a former presidential candidate, said. The court's ruling centred on the one-third of seats that were meant to have been set aside for independents. Since candidates linked to the main parties had also been allowed to contest those seats, they were invalid, the court said. After the parliamentary elections the Muslim Brotherhood ended up with nearly half the seats in the new assembly, with ultraconservative Islamists taking another 20 per cent. "The People's Assembly does not exist according to the power of the law," said a court statement quoted on state television. Farouk Sultan, the head of the constitutional court, said: "The ruling regarding parliament includes the dissolution of the lower house of parliament in its entirety because the law upon which the elections were held is contrary to rules of the constitution." Egypt's military rulers would need to call new parliamentary elections, he added. The dissolution of parliament places the Brotherhood and its parliamentary allies in a tough position, analysts said. Mr Morsi must decide whether to continue to participate in a presidential election process now badly tainted. On Thursday Mr Morsi, in an interview on a privately owned channel, said he "respected" the court's rulings and would remain in the race for president. The military said the election would take place as scheduled. "This is a clear move against the Brotherhood," said Heba Morayef, a researcher for Human Rights Watch. The military has struck at the Brotherhood's power base. One of the few people to express support for the rulings was Mr Shafiq, whose opponents regard him as a proxy for the old regime and Egypt's military. He appeared later at a boisterous campaign rally to call the court's actions "historic" and sending a message that "the era of score-settling and tailor-made law is over."