The Countess of Wessex was reportedly forced to write letters of apology to politicians and senior royals after she feared recordings of her making "horribly indiscreet"' comments about The Queen and Cherie Blair had been leaked to the press.
Prince Edward's wife was targeted by NoTW investigative reporter Mazher Mahmood, after he received a tip-off from Max Clifford that the Countess's PR company was selling access to the royal family in 2001.
Mahmood posed as a Sheikh interested in hiring her PR firm and during a meeting, recorded Sophie making disparaging comments about the late Diana, Princess of Wales, the Queen Mother, Tony and Cherie Blair and William Hague.
The 'Sophie tapes' recorded by the undercover reporter revealed the royal describing Tony Blair as being 'far too presidential' while Cherie Blair was 'just horrid. Absolutely horrid, horrid, horrid'.
The Countess is further alleged to have told the fake sheikh that Charles and Camilla will marry, but not until 'the old lady dies' referring to the Queen Mother. She is also said to have referred to the Queen as 'the old dear'.
Former News International chief executive Rebekah Brooks, who is at the centre of the ongoing News of the World phone hacking trial, told the Old Bailey that in a deal with the Palace, Sophie was forced to give an exclusive interview to the News of the World, in exchange for the embarrassing story being dropped.
The undercover operation was instigated after a former 'disgruntled' employee of the Countess approached the newspaper alleging that she countess and her business partner were using her royal connection to boost their business.
After the investigation, Brooks concluded that there was no evidence that the Countess had personally offered access to the royals.
Brooks told the court: "In the meantime, the Countess of Wessex, having been told by us, had realised that during the course of trying to get Maz as a client she had been horribly indiscreet about members of the royal family and politicians and obviously remembered what she said.
"'So she wrote to everybody involved. She was particularly mean about Tony Blair and Cherie, William Hague, so she wrote these letters.'
However, the letters were leaked and were published by the Mail On Sunday. Brooks claimed that in light of the leaked lettters, publishing details of the original story was then justified.
"I'm assuming someone from the palace leaked this to the Mail on Sunday, but that's an assumption. If it was us and the palace that knew," said Brooks.
Afterwards, Brooks wrote an extesnive email to the head of the investigations unit, Greg Miskiw, discussing the operation saying: "We have got to learn some lessons from Sophie. As I said, all our entrapment and subterfuge must be justified 110 per cent. We have to (sic) so careful and make sure everything we do is inside the law.
"I know Sophie was 110% justified in every way and our methods were right and proper. We must continue this standard with all our investigations."
Asked why she would have sent that email, Brooks told the court that there had been 'a lot of things said' about the operation that were not true.
"Because I had had particular involvement in this, I was quite cross because I felt that at every stage in the Countess of Wessex investigation we had adhered to the code and used the public interest exceptions and had behaved responsibly on the actual final decision, did we have enough of a story?'
The trial continues.