The editor of The Times apologised today to a detective unmasked by a former reporter of the newspaper who allegedly hacked his email.
James Harding told the Leveson Inquiry into press standards that he "sorely" regretted the intrusion and expected "better of The Times".
Scotland Yard detectives are investigating claims that the Times journalist, named as Patrick Foster, accessed the email of Lancashire detective Richard Horton in 2009 to unmask him as the author of the anonymous NightJack blog.
Mr Harding told the inquiry on January 17 that one of his reporters was issued with a formal written warning for professional misconduct for gaining unauthorised access to an email account.
The inquiry has heard that The Times fought a High Court battle to name Mr Horton as the writer of the NightJack blog after the reporter told his managers he had tried to access an email account.
Recalled to the inquiry to give evidence on the subject today, Mr Harding started by saying: "In the last couple of weeks I have learned a great deal more about what happened in this incident.
"As editor of the paper, I am responsible for what it does and what its journalists do.
"So I want to say at the outset that I sorely regret the intrusion into Richard Horton's email account by a journalist then in our newsroom.
"I am sure that Mr Horton and many other people expect better of The Times. So do I.
"So on behalf of the paper, I apologise."
Mr Harding said he strongly believed the story had a public interest but he would not have approved the "intrusion" in question.
"If Mr Foster had come to me and said 'I would like to seek unauthorised access to a person's email account to identify a police officer as an anonymous blogger', I would have said that I didn't believe that that intrusion was warranted in the public interest," he said.
"I do believe strongly that this story had a public interest but if he had come to me in advance, that would have been the position I would have taken.
"Clearly, he didn't come to me in advance."
The inquiry was shown an email Mr Foster sent before his story was published to the newspaper's then home news editor, Martin Barrow, who is understood to have advised him to consult Times legal manager Alastair Brett about the story.
Mr Foster then wrote again to Mr Barrow, telling him Mr Brett was "on side", the inquiry heard.
But Mr Foster wrote in the same email, shown at the hearing, that he wanted to keep the story out of the paper on the coming Saturday because, among other things, he wanted a "little more space between the dirty deed and publishing".
Mr Harding said: "Clearly this email assumes he wanted to put some space between what he had done in seeking access to that email account and his efforts to identify (the blogger) using legitimate sources."
The inquiry was shown legal documents relating to the High Court battle to name Mr Horton.
In one, the discovery of the detective's identity was described as "self-starting journalistic endeavour", while another said: "Mr Foster was able to establish the claimant's identity using publicly available materials, patience and simple deduction."
Mr Harding admitted that it later came to his attention that Mr Foster had gained unauthorised access to Mr Horton's email account.
He said he has since written to Mr Justice Eady, who passed judgment on the case, "to apologise for the fact that this was not disclosed to the court".
But Mr Harding told the hearing he had not been aware at the time that his newspaper was taking the matter to the High Court.
"For me personally the biggest shock was that The Times had taken the case to the High Court and I was not aware of this fact," he said.
He conceded however that "we probably didn't drill down properly into exactly what Mr Foster had done."
He went on: "The issues in this case were all coming to me at the same time, ie. why were we seeking to identify an anonymous blogger? What was the public interest in that? Why was a case being taken to the High Court without me being informed?"
He did not know exactly what Mr Foster had done at this stage, he said, adding that "it just seemed to be a highly intrusive piece of reporting without prior approval. I can see now that we paid insufficient attention to this matter at the time".
He said he did not recall having read an email about the case sent by Mr Brett on the evening of the High Court hearing, pointing out that it was the day of the local elections and that there was an effort under way to oust then Prime Minister Gordon Brown at the time.
The inquiry also heard that Mr Brett had been made aware of "an incident at Oxford where (Mr Foster) had been temporarily rusticated for accessing someone else's email account without authority".
Mr Foster was an Oxford University graduate when he was hired by The Times as a trainee.
Rustication from the university means being suspended.