Andy Coulson's on-off affair with Rebekah Brooks went on for nine years and stopped for good only around the time he resigned as editor of the News of the World, the hacking trial has heard.
The relationship began before Coulson became Brooks's deputy at the News of the World (NotW) in 2000 and continued for periods after he took over the helm and she moved to the Sun in 2003, the court heard.
In an anguished letter Brooks wrote but never sent in February 2004, she said she had been "waiting for six years" for him.
But today, Coulson, a married father of three, said it was "not a wholly accurate representation" of events and revealed the affair ended around the time he left the Sunday tabloid in January 2007.
The pair are accused of being part of a conspiracy to hack phones at the now-defunct newspaper between October 2000 and August 2006.
Under cross-examination by prosecutor Andrew Edis QC, the ex-No 10 spin doctor told the court that he had a different interpretation from his co-defendant.
He said the affair started in 1998 and stopped "soon after" but it resumed around the end of 2003 or early 2004.
He said: "In between time, there was a very long period the relationship was what it should have been, which was friendship.
"From 2004 it was by no means continuous but the affair did continue until around the time I left the NotW."
Asked if Brooks's version was wrong, Coulson replied: "I'm not using the words completely false - it was a very complicated situation. People have different interpretations of it on both sides."
His wife Eloise was in court as he gave evidence for the seventh day at the Old Bailey.
The defendant went on to deny that he "turned a blind eye" to the hacking of a voicemail in which David Blunkett declared his love for Spectator publisher Kimberly Fortier in 2004.
Coulson had earlier told the jury it was the one and only time he heard about phone hacking during his time at the paper.
He was asked why he never inquired of chief reporter Neville Thurlbeck where he got the taped phone message when he first rang him on holiday in Italy to tell him about it.
Mr Edis said: "There's only one reason why you would not ask him and that's because you already knew Neville had Mulcaire hacking voicemails."
Coulson said: "That's not true."
Mr Edis went on: "Is it that you did not really want to know about the phone hacking Neville Thurlbeck had done and you've got to assume he was doing it himself because you always denied you knew about Glenn Mulcaire?"
Coulson said: "I did not."
Mr Edis asked: "Is it because you would rather not know? Ask no questions... Turning a blind eye."
Coulson said: "I accept that I failed.
"I don't think I turned a blind eye - to turn a blind eye, you would have to have some knowledge. What I'm saying is it was a mistake, a bad mistake."
Mr Edis said: "If Neville Thurlbeck had told you he had robbed a bank, you would not tell him to stop. Telling him to stop was not addressing the problem because it's something he has already done."
Coulson replied: "I was concerned that it stopped and that was the instruction I gave to him."
He was also questioned about why, when he was arrested in July 2011, he never told police his version of events surrounding the Milly Dowler and David Blunkett stories, which came from hacking, and his authorisation of payments to convicted hacker Glenn Mulcaire.
Mr Edis said: "What you intended to achieve was this - you avoided making any admission about David Blunkett and Milly Dowler, hoping they would never be able to prove it."
Coulson replied: "I decided that the best thing for me to do was to follow the advice of my solicitor."
The lawyer pressed: "In the years that followed, you have appreciated the evidence you knew about the hacking of Mr Blunkett before you went to see him is overwhelming so you had to make the admission."
Coulson said: "No. I have chosen to explain what happened in relation to Mr Blunkett."
Mr Edis also asked for an explanation for the lack of notes from the time.
"There is not a single notebook in existence from your time at the News of the World concerning these things I have been asking about.
"Are there any notebooks of yours in existence, Mr Coulson?"
Coulson replied that he had some from his political career but he tended to email himself notes rather than write in books.
After he resigned, he said his personal assistant dropped off belongings, including a punchbag which hung in his office, but he could not recall if there were any notebooks.
Earlier, the court heard that when he resigned over former royal editor Clive Goodman's phone hacking in 2007, he agreed a leaving package of £600,000.
The same day his departure was announced, Goodman was jailed, with private investigator Mulcaire, making him "effectively unemployable", his lawyer David Spens QC said.
The defendant said the agreement he made was for two years' pay plus a month for every year served. He added: "I did not consider that unusual."
Coulson, 46, of Charing, Kent, and Brooks, 45, of Churchill, Oxfordshire, deny conspiring with others to hack phones. The also deny separate charges of conspiring to commit misconduct in public office. All seven defendants deny the charges against them.
The trial was adjourned until 11.30am on Monday.