* Court hears of affair at heart of Murdoch empire
* Brooks, Coulson both later close to PM Cameron
* Prosecution says both knew of hacking by reporters
* Defendants deny charges
By Kate Holton and Michael Holden
LONDON, Oct 31 (Reuters) - Rebekah Brooks and Andy Coulson, two former editors of Rupert Murdoch's now defunct News of the World tabloid, were having an affair at the time their reporters are accused of hacking into phones, a court heard on Thursday.
Prosecutor Andrew Edis said the intimacy of their relationship indicated each knew as much as the other about how their reporters were operating. Both have denied conspiring to hack into phones or making illegal payments to public officials.
"What Mr Coulson knew, Mrs Brooks knew too. What Mrs Brooks knew, Mr Coulson knew too," Edis told the court. "That's the point."
Coulson went on to become the chief media spokesman for Prime Minister David Cameron while Brooks, a close confidante to Murdoch, went on to be chief executive of News International, the tycoon's British newspaper group.
The revelation of the affair is likely to bring more embarrassment to Cameron, who has long been accused by critics of being too close to Murdoch's News Corp media empire.
Murdoch owns The Sun and Times papers and 39 percent of pay-TV group BSkyB, which opponents say enables him to wield too much political influence in Britain.
"Mrs Brooks and Mr Coulson are charged with conspiracy, and when people are charged with conspiracy the first question the jury have to answer is, how well did they know each other?" Edis said. "How much did they trust each other?"
The affair went on from 1998 to 2004, Edis told the jury at London's Central Criminal Court.
Brooks and Coulson showed little reaction to the revelation as they sat side-by-side in the glass dock along with six other defendants, including Brooks's husband Charlie, whom she married in 2009.
The prosecutor said the relationship was discovered after police found a document containing a 2004 letter on a computer at Brooks's home. Brooks wrote the letter to Coulson after he tried to break off the relationship, Edis said.
"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," the letter said, according to Edis who read it out to the jury of nine women and three men.
"In fact without our relationship in my life I am not sure I will cope."
Edis told the jurors that it was not the affair in itself that was important to the prosecution's case.
"It isn't simply that there was an affair, it isn't to do with whether they have sexual relations with one another, (it is to do with) how close were they ... and they were very close," he said.
Revelations about phone-hacking engulfed News Corp during the summer of 2011, forcing the closure of the 168-year-old tabloid News of the World and embarrassing senior politicians and police who were shown to have very close links to press barons including the 82-year-old Murdoch.
Earlier on Thursday, the jury heard that Brooks and Coulson had authorised huge payments to the man behind the hacking at a time when the News of the World was drastically cutting costs.
Brooks and Coulson ordered senior staff to slash budgets but allowed about 100,000 pounds ($161,000) a year to go to Glenn Mulcaire, the private detective who has admitted tapping mobile phone voicemails for their paper.
"What was so special about him?" Edis asked the jury of Mulcaire. "Well, what was so special about him was that he was doing phone-hacking."
The jury were shown emails which Edis said revealed the tight financial restrictions and the pressure Britain's best-selling newspaper was under to maintain sales.
"I am very worried about news desk's spending, what is going on? It's a disciplinary situation. How am I going to make myself any clearer?" Brooks wrote in an email to her senior news staff in June 2001 shortly after berating one for spending 7,500 pounds on one story.
Showing the pressures within the newsroom, Coulson told senior staff in April 2005 that the paper "needed a hit badly," in terms of the quality of the stories they were breaking. Edis said the jury would have to decide whether that pressure was a factor in the decision by some staff to break the law.
In a bid to get ahead on salacious front-page stories, reporters on the Sunday tabloid repeatedly hacked the phones of senior politicians, royalty and even rival journalists to get big stories, the jury heard.
"In the dog-eat-dog world of journalism, in this frenzy to get this huge story, and to try and get something better or at least as good as what everyone else has got, that is what you do if you're Ian Edmondson," Edis told the jury of nine women and three men.
"You hack the competition."
Edmondson, one of the six others on trial, ran the news gathering desk at the tabloid when Coulson was the editor.
All eight defendants in the trial deny all the charges against them. The trial is expected to last for six months.