A judge has accused Scotland Yard of committing a "state-created" crime by setting up an undercover money-laundering operation to catch suspected drug dealers.
The case has lasted five years
Southwark Crown Court heard that detectives set up a false company, laundered £15m and then gave it back to the suspects so that the police could continue gathering evidence.
As the case against 10 defendants collapsed, the police reacted with disappointment and shock.
The case has lasted five years and taxpayers are now facing an estimated bill of £25m for the costs - with the possibility of civil action by defendants seeking compensation adding to the bill.
The 10 who were cleared
Christopher Finch, 55, London
Plinio Bossino, 63, London
Tony Harwood, 31, London
Peter Harwood, 51, Staines
William Hunt, 55, London
Ian Howard, 60, Redhill
Michael Roper, 36, Liverpool
Lee Doran, 29, London
Anthony Zaitzeff, 67, undisclosed address
Thierry Leclerc, 52, London
Despite the collapse and cost, Metropolitan Police deputy assistant commissioner Bill Griffiths described the undercover operation as successful because 21 convictions had been handed down, totalling more than 100 years of imprisonment, and eight drug trafficking gangs had been dismantled.
Judge George Bathurst-Norman described the police action as "massively illegal", adding that in the case of two suspects it amounted to entrapment.
"Laundering money in such large quantities back to suspect criminals will raise question marks in any right-thinking member of the public," he said.
Scotland Yard said it had gained approval from all relevant authorities at every stage of the operation, and police had liaised with the Crown Prosecution Service throughout.
"The judge's recent ruling is one which has serious implications for all aspects of undercover policing," Mr Griffiths said.
"(It is) our own view that the officers did not break the law."
The large-scale operation, which lasted years, was aimed at alleged drug barons using Gibraltar and other routes to launder seven-figure profits.
But Judge Bathurst-Norman said: "The police offered a wholly exceptional opportunity to others to commit crime... a wholly exceptional offer which no ordinary citizen or money launderer could provide.
"I have come to the conclusion that what the police did amounted to state-created crime..."
Detective Superintendent Geoff Hunt, who oversaw Operation Cotton as it was known, said he did not accept the judge's ruling.
"It has been a complex case. The ruling is quite a shock to us," he said.
As part of the undercover operation, a company set up with Scotland Yard approval came complete with bogus financial records filed by accountants who were granted immunity from prosecution.
Once "cleaned up", the suspect sums were handed back to bolster the police operation's fiction and allow police to continue gathering evidence.
The court heard that lawyer Christopher Finch and businessman Plinio Bossino were regarded as principal players in the alleged criminality.
They were eventually lured to Britain and arrested. Eight others were also detained.
Following the decision, Mr Bossino's lawyers called for an "immediate inquiry into how the Metropolitan Police thought it fit to conduct an illegal and unauthorised
undercover money laundering operation for so many years".
The lives and reputation of Mr Bossino and his family had "irretrievably damaged" because of the operation, his lawyers said.
Court hearings took 418 days with stop-start legal arguments continuing over five years.
Following Monday's ruling, in which the case against three of the defendants was halted, Alan Rawley QC, prosecuting, said it was only "correct" that the proceedings against the remainder should be "permanently stayed".
During his three-day judgment, the judge strongly condemned both the investigation and the way in which the case was subsequently handled.
But he made clear any criticisms levelled at the police were based on their "incompetence" - there was no question whatsoever of "bad faith".
The court heard Operation Cotton was started 14 years ago amid growing concerns over large drug money laundering
The judge said the undercover operation had gone on long after police had the necessary evidence to arrest some of those eventually detained, but they had wanted to see who else "fell into the net".