The Tulisa drugs sting trial collapsed after the judge agreed that Sun on Sunday reporter Mazher Mahmood told a “deliberate lie” in a pre-trial hearing.
The Mahmood “lie” centred around evidence given to police by driver Alan Smith who picked up Contastavlos from a London hotel in May last year.
At the pre-trial hearing Mahmood said he had not "asked, found out or discussed" with Smith anything that was said in the car during the journey from the Metropolitan Hotel on 10 May last year.
He also denied discussing Smith's statement that was "apparently favourable" to the singer because she had expressed "disapproval" of drugs, prosecutor Tim Cray said.
But at trial, the reporter said he had discussed what was said in the car with Smith and said the driver had sent him a copy of his statement, the prosecutor said.
Smith had told Mr Mahmood there was a problem with his statement in that he could not remember who had made the comment disapproving of drugs and police had "told him to leave it", the court heard.
Mahmood then advised him to tell police about the problem with the statement, the prosecutor said.
The alleged exchange was said to have taken place during the afternoon of 24 June – three days before Mahmood gave evidence that he had not discussed Smith's statement or evidence.
Cray said: "There may be a number of reasons for the change in Mr Mahmood's evidence but the reasons for the change are secondary to what the evidence reveals about Mr Mahmood's honesty and his ability to manipulate the court's process."
The journalist's conduct during the voir dire hearing "created … the question of whether it is fair for them (the defendants) to be tried at all".
Mahmood's journalistic practices also came under the spotlight during the trial.
He told the court he began probing Contostavlos after receiving a tip-off that she "arranges drugs for a close circle of friends".
The undercover reporter was forced to deny accusations from Contostavlos's barrister Jeremy Dein QC that he entrapped celebrities, bent the truth and invented sources to create "big-time, glamorous stories which enhance your reputation and the paper".
In a series of legal arguments, Dein accused Mahmood of having a "long and chequered history" and of "inventing informers and for creating factual scenarios which are not true".
He said the journalist "tricked and deceived" Contostavlos by wining and dining her at five star hotels and luxury restaurants in a "campaign of entrapment".
To support his case he called former tipster and Kosovan asylum seeker Florim Gashi, who claims to have made up a string of stories with Mahmood at the now defunct News of the World.
Gashi told the court: "Everything was pre-planned from Maz and basically I was involved in assisting him, helping him make up stories for his newspaper."
He said a front-page story in the News of the World in 2002 in which Mr Mahmood claimed to have exposed a plot to kidnap ex-Spice Girl Victoria Beckham and hold her ransom for £5 million, was a set-up.
Five men were arrested but later cleared when the prosecution case collapsed after it was revealed Gashi had been paid £10,000 for the story despite having criminal convictions to his name, and was therefore deemed an unreliable witness.
Questioned about the story, Gashi told the court: "There was nothing genuine in regards to kidnapping Victoria Beckham. This plan originated from Mazher Mahmood and I assisted him to my best to make this story happen."
He accused Mahmood of throwing away tape recordings if they contradicted a story and luring people into committing crimes.
But giving evidence behind a screen to protect his identity, Mahmood vehemently denied the claims and insisted he always took legal advice.
He said: "The information was that she supplies drugs to her friends. She supplied drugs to me – simple."
Mahmood talked about Gashi during evidence to the Leveson Inquiry in 2012. He said: “This is a man who's made allegations against me to the police. The question didn't arise, really
“We fell out after he was deported so I haven't spoken to him or dealt with him since. In fact, he was ringing me up threatening me from Albania.”