Egypt's highest court declares parliament invalid Former Egyptian Prime Minister Ahmed Shafik. NEW: Egypt's highest court declares parliament invalid The Supreme Court rules Ahmed Shafik can run for president A runoff vote is set for this weekend between Mohamed Morsi and Shafik Shafik was Hosni Mubarak's last prime minister Cairo (CNN) -- Egypt's highest court on Thursday declared the country's parliament invalid and cleared the way for a member of former President Hosni Mubarak's regime to run in a presidential election runoff this weekend. The Supreme Constitutional Court ruled that parliament must be dissolved, state TV reported. An Egyptian constitutional law expert told CNN that following the court's decision, a political decision will be made about whether to dissolve parliament. Parliament had been in session for just over four months. The court found that all articles making up the law that regulated parliamentary elections are invalid, said Showee Elsayed, a constitutional lawyer. Elsayed is also the attorney for former Prime Minister Ahmed Shafik, who will be allowed to run in this weekend's runoff election due to a separate decision by the same court Thursday. The court ruled that a law barring former regime members from running in the election is unconstitutional. Shafik was the last prime minister under Mubarak. The runoff Saturday and Sunday pits him against Mohamed Morsi, head of the Muslim Brotherhood's political arm. Riot police and military personnel, some in armored vehicles, were outside the court ahead of the rulings. Military intelligence officers were also present. After the ruling about Shafik was announced, a crowd of citizens shouted their disapproval. Military police moved to block the road in front of the court -- a major Cairo artery. Protesters outside the court chanted slogans against the former Mubarak regime and Shafik. Ahmed Yousef, a protester with the April 6 Movement, said: "The military wants Shafik, the court will not rule against him -- but we don't care, we will continue to fight against him." "Those who don't want to see a return to the oppression of the past ... are very unhappy with this ruling," CNN's Ben Wedeman said from Cairo. Many voters were unhappy with both choices in the runoff. Morsi and Shafik are the most nonrevolutionary of all candidates and represent "two typically tyrannical institutions: the first (Morsi) being a member of the Muslim Brotherhood, and the second (Shafik) a senior official of the former regime," Sonya Farid wrote for Al Arabiya earlier. "Everything about Egypt's revolution has been unexpected, and the first-round results in the country's first-ever competitive presidential elections are no different," Omar Ashour, director of Middle East Studies at the University of Exeter and a visiting scholar at the Brookings Institution in Doha, Qatar, wrote for Project Syndicate previously. Egypt's voters "overwhelmingly chose the revolution over the old regime ... but their failure to unite on a single platform directly benefited" Shafik," Ashour said. The rulings come a day after Egypt's military-led government imposed a de facto martial law, extending the arrest powers of security forces. Egypt's Justice Ministry issued a decree Wednesday granting military officers the authority to arrest civilians, state-run EGY News reported. The mandate remains in effect until a new constitution is introduced, and could mean those detained could remain in jail for that long, the agency said. Lawyers for the Muslim Brotherhood filed a court appeal Thursday against the decree. A decades-old emergency law that critics said gave authorities broad leeway to arrest citizens and hold them indefinitely without charges expired on May 31. The political scene in Egypt remains tense after the parliament failed to agree on a committee to write a new constitution defining the powers of the president and the parliament.