The decision to expose David Blunkett's affair with a married woman in the News of the World based on an intercepted voicemail was a "mistake" but showed "the system worked", Andy Coulson told the hacking trial.
The former News of the World editor who had an on-off affair with his co-defendant Rebekah Brooks, added: "The irony is not lost on me."
Coulson was being cross examined by former NoW royal editor Clive Goodman's defence lawyer during his sixth day giving evidence at the Old Bailey.
He was challenged on what he knew about hacking involving six of his staff at the now defunct Sunday tabloid, including Goodman who pleaded guilty in 2006.
The ex-No 10 spin doctor denied all knowledge except for one occasion when chief reporter Neville Thurlbeck played him Blunkett's voicemail message declaring his love for then Spectator publisher Kimberly Fortier in 2004.
Asked why he had not been curious about where the voicemail came from, Coulson said: "I'm not telling the jury I was not that curious, I'm telling the jury what happened. The most important thing in my mind was that it stopped."
The court heard that Coulson later changed his mind and decided to go ahead with the story about Blunkett's affair.
Goodman's lawyer David Spens QC asked if anything was done to discipline Thurlbeck over the voicemail.
Coulson replied: "I'm sorry, no."
The barrister went on: "The story that is the product of phone-hacking is out but nothing seems to be happening within your organisation to prevent it happening again?"
Coulson replied: "The story had been brought to me by a chief reporter and in a way I had to make a decision about it. I have already said to the court I made a mistake.
"In a way I would argue the system worked because the reporter brought the story to me and I had to make a decision."
Spens asserted that nothing happened to Thurlbeck as a consequence of exposing the private life of Blunkett, "a decent man".
He asked: "Do you feel any shame about what you did?"
The witness replied: "I regret the decision," and added: "The irony is not lost on me."
Coulson, 46, of Charing, Kent denies conspiring to hacking phones and conspiring to commit misconduct in public office. All seven defendants deny the charges against them.
Coulson was accused in court of "putting pressure" on his royal editor to use phone-hacking to get stories.
Spens suggested: "You were putting pressure on him to use hacking as a way of getting to royals."
Coulson said: "That's not true. I did not ask Clive Goodman to do that."
Referring to the Blunkett voicemail, Spens pressed: "You knew about hacking by this stage."
Coulson replied: "There was one incident which I have explained to the jury in detail."
Spens went on: "Not only did you know about hacking, you were putting pretty strong pressure on him to do better."
Coulson said: "I had put legitimate pressure on Clive to improve his performance."
The lawyer turned to Goodman's arrest for hacking in August 2006 along with private investigator Glenn Mulcaire.
Mr Spens said: "Mr Goodman's case is, because he knew you had been together involved in hacking, you did your very best up until the time of your resignation to make sure that was not revealed."
Coulson said he would "absolutely dispute" telling Goodman that if he pleaded guilty he would avoid prison.
"I may have thought the sooner it was over, the better it would be for the paper. I certainly did not want the pain to be extended."
Mr Spens suggested it was to stop the police investigation going any deeper.
Coulson replied: "My view was that police would go where the police would go."
The witness denied telling Goodman that he had to admit he had "gone off the reservation" during a meeting at Cafe Rouge in Wimbledon days after his arrest.
Coulson told the court he kept his knowledge of hacking at NoW from police partly to save his own skin.
The former editor said he decided not to volunteer information about the Blunkett tape which he heard two years before police began investigating Goodman and Mulcaire.
Spens said: "A reason may have been that would have come back to you and your knowledge of phone-hacking?"
Coulson said: "It may have done."
The lawyer said: "You were concerned to save your own skin."
The witness replied: "I certainly accept it was a factor."
Email pged@pressgazette.co.uk to point out mistakes, provide story tips or send in a letter for publication on our "Letters Page" blog