The convictions of some of Australia's most high-profile criminals have been cast into doubt after a lawyer was revealed to be a police informant.
The defence barrister, who represented notorious organised crime figures, gave information to Victoria Police between 2005-2009, court documents show.
The state government have announced a public inquiry to determine how many convictions were directly affected.
The case came to light when court injunctions were lifted on Monday.
It was the culmination of a two-year court battle in which the police tried to prevent the disclosure of the lawyer's identity to her clients, but the High Court ruled against them.
In a scathing judgement, the court said the Victoria Police department was guilty of "reprehensible conduct" by encouraging the lawyer to provide information about her clients.
"The prosecution of each convicted person was corrupted in a manner which debased fundamental premises of the criminal justice system," the judgement said.
The barrister, who cannot be named for legal reasons, represented key figures in Melbourne's criminal underworld during a period of heightened gang violence.
A vicious gangland feud that claimed at least 28 lives in the city ended more than a decade ago, but detectives say that tensions still fester.
The lawyer kept in daily contact with her police handlers and was given the code name 3838, according to court documents.
Her clients included the high-profile crime boss Tony Mokbel and six of his associates.
In 2012, Mokbel was jailed for a minimum of 22 years for masterminding a drug trafficking operation.
The documents show that the police tried to stop prosecutors from informing the convicted men about their lawyer's role as a police informant.
But the High Court's decision to lift injunctions on the case means criminals will now be sent a letter notifying them of the case.
They could then appeal against their convictions, meaning their sentences could be reduced or convictions quashed altogether.
While the documents only mentioned Mokbel and his associates, Australian media report that hundreds more convictions could be affected.
Speaking on Monday, Victoria Police Chief Graham Ashton defended the use of the lawyer as an informant.
"Melbourne was in the grip of what is now rightly known as the gangland wars," he told reporters. "The risk to the community at this time was significant."
He said that, in 2009, the police department changed how it deals with informants and so a similar incident would not be possible now.
He added that the department would cooperate fully with the public inquiry.
The inquiry was announced by Victorian Premier Daniel Andrews, who said the public had a "right to know that every part of the justice system acts fairly and lawfully at all times".
He said it will be given a budget of A$7.5m (£4.3m, $5.4m) and will begin investigating early next year with the aim of releasing a final report in December.