A Zimbabwean High Court judge has ruled that the military action leading to Robert Mugabe's resignation was legal, a key decision as the military has sought to show that its moves were not a coup.

Experts said it sets a dangerous precedent for the military to step in again.

High Court Judge George Chiweshe on Friday ruled that the military's actions "in intervening to stop the takeover" of Mugabe's constitutional functions "by those around him are constitutionally permissible and lawful."

The military stepped in almost two weeks ago after Mugabe's firing of deputy Emmerson Mnangagwa amid fears that the 93-year-old Mugabe's unpopular wife was positioning herself to take power.

Zimbabwe New President

Emmerson Mnangagwa, centre, and his wife Auxillia, right, arrive at the presidential inauguration ceremony in Harare on Friday. (Ben Curtis/Associated Press)

The judge said the military's actions ensured that non-elected individuals do not exercise executive functions, an apparent reference to then-first lady Grace Mugabe.

Separately, the judge said Mugabe's firing of Mnangagwa as vice president was illegal. Mnangagwa was sworn in as president on Friday in a whirlwind reversal of fortunes, becoming just the second leader of Zimbabwe after Mugabe's 37-year-rule.

The judge's decisions were quickly criticized both by legal and rights experts and by close allies of Mugabe and his wife.

"If these breathtaking High Court Orders granted in Harare yesterday represent what is being peddled as a 'new path,' then please pray for Zimbabwe," tweeted minister of higher education Jonathan Moyo, the most vocal of the Mugabe's allies.

The southern Africa director for Human Rights Watch, Dewa Mavhinga, called the rulings "incredible" and said on Twitter: "Strange, captured judiciary?"

Zimbabwe's military sent tanks into the streets overnight on Nov. 14, taking control of the state broadcaster and announcing that Robert Mugabe had been put under house arrest. It also said it was pursuing "criminals" close to Mugabe who were accused of harming the country's economy.

The military's move led the ruling party to turn against Mugabe, launching impeachment proceedings before Mugabe on Tuesday announced his resignation, while tens of thousands of Zimbabweans took to the streets in a military-backed demonstration urging Mugabe to step aside.

Mnangagwa, who fled the country shortly after his firing, said upon his return that he had been in "constant contact" with the military during his absence.

Many in the international community avoided calling the military's actions a coup, instead urging that Zimbabwe's authorities respect the rule of law during the turmoil.

Zimbabwean lawyer Alex Magaisa said the new rulings by the High Court judge "may come to haunt Mnangagwa's government" by setting a dangerous precedent by "effectively legalizing military intervention in the affairs of government."

He also wrote Saturday that "it is interesting to note that the order was granted by `consent' which suggests that Mugabe agreed to it. If he did, it could be that it was part of Mugabe's exit deal."

Mugabe still in Zimbabwe

Mugabe has not been seen in public since his speech to the nation on Sunday that defied calls to resign. He will remain in Zimbabwe, and Mnangagwa met him on Thursday and assured him of "maximum security," the state-run Zimbabwe Herald has reported.

Mugabe did not attend the swearing-in on Friday of Mnangagwa, a 75-year-old former defence and justice minister who has been blamed for a number of crackdowns under Mugabe's rule.

In his first speech as president, Mnangagwa spoke of reuniting the country and reaching out to the world after years of international condemnation and sanctions over rights abuses and allegedly rigged elections. Let "bygones be bygones," he said, and he has warned against "vengeful retribution."

A number of cabinet ministers have not been seen publicly since the military swept in, while rights activists have begun sharing worrying details of assaults and raids on their homes amid concerns about possible retaliation.

Also Saturday, Finance Minister Ignatious Chombo was to appear in court after accusations of corrupt land deals dating back to his time as minister in charge of local government, his lawyer Lovemore Madhuku told The Associated Press.

Chombo was assaulted after the military moved in, the lawyer said. He was detained by the military but now is in police custody.

Charges against the minister were read out Thursday while he lay in bed at a government-run hospital, the lawyer said.