The National Court of Papua New Guinea has issued a permanent stay on proceedings against the chief justice of the supreme court.
Sir Salamo Injia was arrested last week in the capital, Port Moresby, and charged with attempting to pervert the course of justice amid police allegations he illegally diverted 213,000 kina ($94,000) into court coffers.
Calling the charges an abuse of process, Judge George Manuhu on Tuesday granted a permanent stay on proceedings and issued a restraining order stopping police from arresting Sir Salamo.
"The chief justice was just doing his job by ensuring the payment of entitlements were correct," Judge Manuhu said.
"Police must not become an instrument of ... revenge and of unnecessary proceedings."
The stay comes amid increasing criticism from political and judicial circles that the arrest of Sir Salamo was politically motivated.
Police allege that in 2009 he cancelled a cheque made out to the son of the late Justice Timothy Hinchliffe and had the funds redirected into the National Court trust.
Judge Manuhu said the payments had been squared with Justice Hinchliffe's son, Timothy Sarri, in November last year.
"The judge's adopted son collected every single toea (cent) he wanted," Judge Manuhu said.
The court order comes after the leak of a memo from supreme court Justice Nicholas Kerriwom to colleagues asking them to take out a public notice explaining Sir Salamo's role in handling the funds.
Police say they have tried to bring charges against Sir Salamo since 2009 but have been thwarted by repeated court orders stopping them from investigating.
On Sunday, police commissioner Tom Kulunga issued a defence of the arrest of Sir Salamo and criticised the judiciary for blocking investigations.
"If the court is going to scare the police away with court orders every time police investigate senior people in this country, I suggest we decommission the police department and the criminal justice process and allow the national and supreme court to play their roles," he said in a statement.
Sir Salamo was one of five judges who oversaw last year's constitutional battle over whether Sir Michael Somare or Peter O'Neill was the constitutionally elected prime minister of PNG.
Lawyers representing members of the O'Neill government tried three times to have the chief justice removed from the case, before Deputy Prime Minister Belden Namah made the police investigation public in November.
That, along with an attempt to suspend Sir Salamo, landed Mr Namah and Attorney General Dr Allan Marat briefly in jail for contempt of court.