Police in Victoria spent $4.52m in legal costs attempting to prevent the release of information about the use of a gangland lawyer as an informant.

Suppression orders preventing the publication of information about what has become known as the Lawyer X or Informer 3838 case were lifted by the high court on Monday, following a two-year legal battle.

Police and the woman known as Lawyer X were attempting to block commonwealth and state prosecutors from releasing information about her role as an informer on her gangland clients, several of whom were convicted after she gave confidential information about them or their associates to police.

The lifting of the court orders allowed prosecutors to write to 22 people on Monday informing them that they may have grounds to launch an appeal. Underworld figures Tony Mokbel, Rob Karam, and the family of Carl Williams, who was murdered in prison while serving a life sentence for murder, are reportedly considering appeals.

The high court described it as an “atrocious” and “reprehensible” case of police misconduct, and an “appalling” breach of Lawyer X’s duty to both her clients and the court.

It prompted the Victorian government to call a royal commission to examine how many criminal convictions – including those of some of the most high-profile figures of Melbourne’s gangland wars – may be affected.

Victoria Police confirmed to Guardian Australia in a statement that it spent $4.52m on legal costs in order to protect Lawyer X’s safety.

It warned the court on multiple occasions that Lawyer X would be murdered if the information was released. The court acknowledged there was a risk of death to Lawyer X and her family, but said it didn’t supersede the public interest in restoring faith in the justice system.

“Our priority throughout has been the safety of the lawyer and her family who we feared would be murdered if identifying information was released,” Victoria Police said. “We are duty bound to do all we can to keep people safe.”

The chief commissioner, Graham Ashton, has defended his own role in the scandal, saying he knew about the use of the lawyer as an informant while she was still active in the role through his position as head of the Office of Police Integrity.

“I am very confident in my own knowledge and role that I’ve done nothing wrong in this,” he told ABC Melbourne in his first interview after the royal commission was announced.