MANILA — The Philippine Justice Department has nullified an order to deport an Australian nun who was arrested after joining street protests criticizing President Rodrigo Duterte’s brutal war on drugs.

The justice secretary, Menardo Guevarra, said the order expelling Sister Patricia Fox, 71, was “without legal basis” because the Bureau of Immigration did not explicitly have the power to declare her visa forfeit.

“What the B.I. did in this case is beyond what the law provides — that is why it has to be struck down,” Mr. Guevarra said.

He said that withdrawing Sister Fox’s visa without any legal basis was tantamount to creating “new procedures or new grounds.”