By Michael Holden

LONDON (Reuters) - Mazher Mahmood, one of Britain's best known undercover reporters renowned for his "fake sheikh" sting operations that have even caught out royalty, tampered with evidence in a criminal trial to protect his reputation, prosecutors said on Wednesday.

Mahmood, who has worked for several of Rupert Murdoch's papers, is on trial accused of conspiracy to pervert the course of justice over the 2014 prosecution of singer and former judge of the British version of the "X Factor" TV talent show Tulisa Contostavlos.

She had denied being involved in supplying drugs to Mahmood while he posed as an influential Indian film producer, and the case against her later collapsed.

Mahmood and his driver Alan Smith are accused of changing a statement Smith had given to police ahead of her trial which could have helped her defense, London's Old Bailey central criminal court was told.

Prosecutor Sarah Forshaw said Mahmood, who called himself the "king of the sting", had a vested interest in Contostavlos being found guilty as his own journalistic practices were on trial.

"This is a case about an agreement made between these two defendants to tamper with evidence in a criminal trial," she said. "Mr Mahmood may be the master of subterfuge and deception. But on this occasion it is he, together with his employee, who are exposed."

The journalist, who denies the accusations, has built a formidable reputation for undercover investigations which have led to major exclusive stories and prominent prosecutions.

In his most famous exclusive in 2001, he posed as an Arab sheikh to dupe Sophie, Countess of Wessex, the wife of Queen Elizabeth's youngest son Prince Edward, into making indiscreet comments about other members of the royal family and senior politicians.

The Contostavlos sting involved the aspiring actress being flown first class to Las Vegas with the promise that she was favorite for a lucrative film role. At a subsequent meeting in London, the pair discussed drugs and a friend of hers later supplied Mahmood with half an ounce of cocaine.

The story appeared as an exclusive in the Sun on Sunday newspaper and police launched an investigation into Contostavlos.

Shortly before her trial, Mahmood's driver Smith told a police officer of a conversation between Contostavlos and her personal assistant during which she made clear her disapproval of drugs.

However, the following day after sending a copy of his statement to Mahmood and following a "flurry" of contact between the two men, Smith revised his police statement to remove reference to that conversation.

Forshaw said Mahmood had told police he had no need to interfere with Smith's statement as he had gathered irrefutable evidence against her.

However, the prosecutor said if Mahmood had been shown to have acted improperly in the Contostavlos case or acted as an agent provocateur his own credibility would have been "sorely damaged".

(Editing by Stephen Addison)