Singer and TV star Tulisa Contostavlos's trial over drugs allegations has collapsed.
Judge Alistair McCreath told Southwark Crown Court he thought prosecution witness Mazher Mahmood had lied in giving evidence.
Mr Mahmood claimed Ms Contostavlos, 26, had brokered a deal through her friend Mike GLC to supply Class A drugs.
The Sun journalist Mr Mahmood has been "suspended pending an internal investigation" the newspaper said.
Ms Contostavlos, the former N-Dubz singer and X Factor judge, had denied the allegations against her.
The judge told the jury the case "cannot go any further" because there were "strong grounds to believe" that Mr Mahmood had "lied" at a hearing before the trial started.
Explaining his decision Judge McCreath said: "Where there has been some aspect of the investigation or prosecution of a crime which is tainted in some way by serious misconduct to the point that the integrity of the court would be compromised by allowing the trial to go ahead, in that sense the court would be seen to be sanctioning or colluding in that sort of behaviour, then the court has no alternative but to say 'This case must go no further'."
Despite an earlier guilty plea Judge McCreath said the case against Michael Coombs would be dropped
The court heard the collapse of the trial hinged on evidence given by the newspaper reporter about a statement his driver, Alan Smith, had previously given to police.
Mr Smith said he had heard the singer talking disapprovingly about drugs but "changed his mind" following a conversation with Mr Mahmood.
Mazher Mahmood is one of Britain's most
successful and controversial investigative
In more than 20 years at the News of the World,
and since, he has written hundreds of stories
exposing drug dealers, paedophiles, immigration
fraudsters and wayward celebrities.
One of his greatest triumphs was his exposure
in 2011 of Test cricket match fixing which led to
the jailing of three Pakistani players.
One of his most notorious scoops came when he
recorded Sophie, Duchess of Wessex, apparently
using her royal connections to solicit business for
her PR firm.
In both cases he pretended to be an Arab sheikh.
But his frequent use of subterfuge has led to
criticism that he is an agent provocateur, who
lures otherwise innocent people into wrongdoing.
And today's not the first time a criminal case in
which he has been involved has collapsed.
In 2006 three men were cleared of conspiracy
after he had offered to sell them a fictional
radioactive chemical called red mercury to make
a terrorist dirty bomb.
One defence barrister in that case called Mazher
Mahmood charismatic and highly intelligent, but
was sharply critical of his methods
In his written statement, Judge McCreath, said: "When he [Mr Mahmood] gave evidence last week, he was asked questions on the same topic and gave answers entirely inconsistent with his earlier evidence."
The judge said he therefore had "strong grounds" to believe Mr Mahmood had lied in evidence to conceal the fact he had manipulated evidence by getting his driver to change his account.
Judge McCreath said: "Had I made the decision then that I have made now neither defendant would have been called on to answer the indictment, nor even enter a plea to it."
As a result, the case could not properly proceed against Ms Contostavlos and therefore could not proceed against Mr Coombs either.
During the trial the court heard that undercover reporter Mr Mahmood, known as the "fake sheikh", had posed as a film producer when he met Ms Contostavlos at several luxury hotels and restaurants.
He claimed the singer had vowed to procure cocaine for him when he offered her a lead role in a film.
Giving evidence from behind a screen, Mr Mahmood said he used "subterfuge" when he secretly recorded meetings to establish whether she was involved in drugs.
'Never dealt drugs'
Under cross-examination he denied the reason was to create a "sensational story" but said it was "in the public interest to expose criminality".
Ms Contostavlos, from Friern Barnet, north London, vehemently denied brokering the deal, which was reported in The Sun on Sunday in June 2013.
Following the dismissal of the case, she urged police to investigate the reporter.
Outside court she said: "I have never dealt drugs and never been involved in taking or dealing cocaine.
Southwark Crown Court heard claims that Tulisa Contostavlos brokered a deal through Michael Coombs
"Mahmood has now been exposed by my lawyers openly lying to the judge and jury. These lies were told to stop crucial evidence going before the jury."
She also claimed she was "tricked" into believing she was auditioning for a movie and was encouraged to "act the part of a bad, rough, ghetto girl".
She said: "They recorded this and produced it as evidence when I thought it was an audition. It was a terrible thing to do.
"Thankfully, the lies have been uncovered and justice has been done."
The singer's co-defendant, Mike GLC, whose real name is Michael Coombs, 36, previously pleaded guilty to supplying cocaine.
Mr Coombs also walked free after he was informed the case against him could not proceed.
Following the announcement, Ms Contostavlos' former boyfriend and N-Dubz band mate Fazer, real name Richard Rawson, tweeted: "Thank god for this!! @officialtulisa #Relieved."
End justified the means
Mazher Mahmood has spent more than 25 years as an undercover reporter and done exposes on celebrities, royals, as well as criminals while working with the Sunday Times, the News of the World (NOTW) and The Sun.
He has been dubbed as the "fake sheikh" after a disguise which he donned for some of his stories.
During the Leveson Inquiry into media ethics and standards, the journalist, who then worked for the NOTW, said he had written about 500 stories for the newspaper and his work had led to more than 260 "successful criminal prosecutions".
In an interview to the BBC he said his undercover work was always in the public interest and the end justified the means.