An undercover Sun journalist allegedly tampered with evidence in the collapsed drugs trial of Tulisa Contostavlos to protect his reputation as "king of the sting".

Mazher Mahmood, 53, known as the "Fake Sheikh", allegedly plotted with his "right-hand man" Alan Smith, 67, to change a statement made to police about the pop singer.

She had allegedly arranged for the journalist to be sold half an ounce of cocaine by one of her contacts for £800.

Mahmood and Smith are on trial at the Old Bailey for conspiracy to pervert the course of justice.

The reporter had a "vested interest" in the prosecution, which put his journalistic reputation on the line, prosecutor Sarah Forshaw QC said.

She added: "Mr Mahmood may be the master of subterfuge and deception. But on this occasion it is he - together with his employee - who are exposed."

Mahmood allegedly posed as an Indian film producer who wanted the aspiring actress to star as a "bad girl" in a Bollywood blockbuster alongside Leonardo DiCaprio.

He handed evidence to police which led to Miss Contostavlos being arrested and charged with being concerned in the supply of a class A drug, the court was told.

The reporter was called as a prosecution witness in the trial and also gave evidence at a pre-trial hearing in June 2014 about his methods during the sting.

Miss Forshaw said: "He liked to call himself the 'king of the sting', he boasted in a book he had written of the number of convictions that he personally was responsible for.

"He knew that if it could be shown that he had acted improperly as an agent provocateur, inducing Miss Contostavlos to do something she would not otherwise do, his own credibility and standing and the prospect of conviction in the case might both be severely damaged."

Mahmood and Smith allegedly arranged to alter a written statement the latter had made to police because it was favourable to Miss Contostavlos's defence.

Miss Forshaw said: "Miss Contostavlos had expressed her disapproval of hard drugs to his (Mahmood's) own driver, that was the bit of the statement that was altered."

A day after making the statement Smith told police he wanted to retract the part about the singer's negative attitude to cocaine, the court was told.

In the intervening 24 hours he had allegedly sent a copy of his interview to Mahmood and they had exchanged a number of texts and calls, the court heard.

During a pre-trial hearing at Southwark Crown Court, Mahmood said on oath that he had not discussed the evidence with Smith.

He later admitted before the jury that he had seen a copy of Smith's statement and the trial subsequently collapsed.

Miss Contostavlos described how she was tricked by Mahmood's alter ego and thought he was going to make her a film star.

She said she talked about an unnamed member of her family with a drug problem while Smith drove her back to her Hertfordshire home from a meeting at the Metropolitan Hotel in Park Lane, London, in May 2013.

"He was staying at my house and had a hard drug problem," she added.

Mahmood, of Purley, south London, and Smith, from Dereham, Norfolk, both deny conspiring to pervert the course of justice.

The trial will continue on Thursday.