Former News International chief executive Rebekah Brooks and ex-'News of the World' editor Andy Coulson had an affair for at least six years, a jury has heard.
Jurors were told that in 2011, police who had been investigating the phone hacking scandal discovered a computer in the wardrobe of Mrs Brooks' London home.
Stored on the computer was a letter she had written to Mr Coulson in 2004, describing her heartache at his decision to end their affair.
Prosecutor Andrew Edis said Brooks declared her love for Coulson in a letter from February 2004, when he tried to end their relationship.
"It is clear from that letter that, as of February 2004, they had been having an affair which had lasted at least six years," the lawyer said
The court heard that the pair had been having an affair dating back to around 1998, spanning the period covered by their phone-hacking conspiracy charge.
Brooks, who was editor of the News of the World (NotW) when Coulson was her deputy, wrote: "The fact is you are my very best friend, I tell you everything, I confide in you, I seek your advice, I love you, care about you, worry about you, we laugh and cry together.
"In fact, without our relationship in my life I am not sure I will cope."
Mr Edis told the jury of nine women and three men that he was not revealing the affair to deliberately intrude into the pair's privacy or to make a "moral judgment".
"But Mrs Brooks and Mr Coulson are charged with conspiracy and, when people are charged with conspiracy, the first question a jury has to answer is how well did they know each other? How much did they trust each other?" he said.
"And the fact that they were in this relationship which was a secret means they trusted each other quite a lot with at least that secret – and that's why we are telling you about it."
He said the revelation was likely to attract a "great deal of publicity" and might draw some "unfair, unkind and unnecessary" comment. Mr Edis said of the letter: "It appears that Mr Coulson was seeking to break off the affair . . . and this is Mrs Brooks' reaction to him telling her that and it is clearly obvious from the letter that it caused her a great deal of grief."
Brooks remained with her head bowed and Coulson looked ahead towards the prosecutor as their affair was revealed.