(CNN)-- Egypt's highest court declared the parliament invalid Thursday, and the country's interim military rulers promptly declared full legislative authority, triggering a new level of chaos and confusion in the country's leadership.
The Supreme Constitutional Court found that all articles making up the law that regulated parliamentary elections are invalid, said Showee Elsayed, a constitutional lawyer.
The ruling means that parliament must be dissolved, state TV reported.
Parliament has been in session for just over four months. It is dominated by Islamists, a group long viewed with suspicion by the military.
The Supreme Council of the Armed Forces, in control of the country since Mubarak's ouster, said that it now has full legislative power and will announce a 100-person assembly that will write the country's new constitution by Friday.
The real obstacle to democracy in Egypt
The Muslim Brotherhood, Egypt's largest Islamist party, said SCAF leaders were taking matters into their own hands "against any true democracy they spoke of."
The court also ruled that former Prime Minister Ahmed Shafik. the last prime minister to serve under ousted President Hosni Mubarak, may run in a presidential election runoff this weekend.
The court rejected a law barring former members of Mubarak's regime from running in the election.
The runoff Saturday and Sunday pits Shafik against Mohamed Morsi, head of the Muslim Brotherhood's political arm.
"We do not need a court ruling to ban Shafik," said Muslim Brotherhood spokesman Mahmoud Ghozlan. "We will put all our efforts into the upcoming elections so that Morsi wins and we avoid the rebirth of the old regime overnight."
"All this equals a complete coup d'etat through which the military council is writing off the most noble stage in the nation's history," said Mohamed el-Beltagy, a member of parliament and a senior member of Morsi's Freedom and Justice Party, in a Facebook posting. "This is the Egypt which Shafik and the military council desire."
Shafik, at a news conference in Cairo, praised the high court for rejecting the rule preventing former regime members from running. "The age of settling accounts is over and gone. The age of using the law and the country's institutions against any individual is over," he said.
Some analysts also called it a coup.
"Egypt just witnessed the smoothest military coup," said Hossam Bahgat of the Egyptian Initiative for Personal Rights, in a tweet after the high court's decisions Thursday. "We'd be outraged if we weren't so exhausted."
Shadi Hamid, director of research at the Brookings Doha Center, said the court rulings are the "worst possible outcome" for Egypt and the transition to civilian rule is "effectively over."
"Egypt is entering into a very dangerous stage and I think a lot of people were caught by surprise," he said.
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.
For Egypt's trapped and teeming, revolution has barely begun
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 non-revolutionary 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.