Media playback is unsupported on your device Media caption John Ryley admits law breach

Ofcom has launched an investigation into the hacking of private email accounts by Sky News.

It comes after Sky admitted earlier this month it accessed the accounts of "canoe man" John Darwin and his wife Anne; and a suspected paedophile.

The head of Sky News, John Ryley, has admitted to the Leveson Inquiry they technically broke the law.

But he said: "It's highly unlikely... that we would be doing this sort of thing in the future."

"I think it's highly unlikely in the future that Sky will consider breaking the law… I'm pretty much ruling it out," he told the inquiry into press practices on Monday.

But he added: "Journalism is at times a tough business and at times we need to shed light on wrongdoing."

The broadcaster admits hacking accounts of John Darwin, who faked his own death in a canoe, and his wife Anne.

Sky has previously said the action was in the public interest and amounted to "responsible journalism", and that the evidence discovered was handed to police.

'Good scoop'

Analysis The timing of Ofcom's announcement is significant - John Ryley, the head of Sky News, was about to give evidence to the Leveson Inquiry into press ethics. The former chairman of BSkyB, James Murdoch, gives evidence on Tuesday. Ofcom says it is investigating "the fairness and privacy" issues raised by Sky News' statement earlier this month that it had hacked into email accounts belonging to John Darwin, his wife Anne, and others. Sky News - which is part-owned by the Murdoch media group - strongly defended its actions, saying they were editorially justified in the public interest. Legally, under the Computer Misuse Act, there is no public interest defence, but Sky said the Crown Prosecution Service had acknowledged there were rare occasions where it was justified for a journalist to commit an offence

Ofcom's broadcasting code includes a clause - Rule 8.1 - which states that: "Any infringement of privacy in programmes, or in connection with obtaining material included in programmes, must be warranted."

The regulator has a range of potential sanctions for breaches of its code, varying from a warning, through to a fine or the revocation of a licence in the most serious circumstances.

An Ofcom spokesperson said: "Ofcom is investigating the fairness and privacy issues raised by Sky News' statement that it had accessed without prior authorisation private email accounts during the course of its news investigations. We will make the outcome known in due course."

As the Leveson Inquiry resumed at the Royal Courts of Justice in central London, Mr Ryley told the hearing that "sources close to the prosecution" of the Darwins had suggested to a Sky reporter - Gerard Tubb - that the emails of Mr Darwin might be of interest.

Lord Justice Leveson asked: "Are you saying that the police encouraged you?"

Mr Ryley denied this and repeated that it was "sources close to the prosecution".

Lord Leveson asked him: "Were you aware of the Computer Misuse Act?"

"I probably wasn't as aware of it as I should have been, to give an honest answer," said Mr Ryley.

Media playback is unsupported on your device Media caption Sky News's canoe man investigation "was pivotal"

The inquiry also heard that when the Sky reporter revealed the information contained within the emails - that Mrs Darwin was in contact with her husband while he was on the run - to police in July 2008 it resulted in her changing her defence at her trial to "marital duress".

She was later jailed for six years for fraud.

Counsel to the inquiry David Barr said the reporter's revelations were "dynamite" and led to a "scoop".

Mr Ryley said he would not use the word "dynamite" but he admitted it was "pivotal" and had led to a "good scoop".

Lord Leveson said: "What you were doing wasn't merely invading somebody's privacy, it was breach of the criminal law."

He asked: "Where does the Ofcom code give authority to a breach of the criminal law?" Mr Ryley conceded: "It doesn't."

Public interest

Image caption John Darwin faked his own death in a canoe accident and fled to Panama

Mr Ryley was also asked about the hacking of paedophile Martin Smith's email account.

Smith was jailed last year for 16 years for child sex offences in Cumbria but was found hanged in his cell in Manchester prison earlier this year.

His wife, Lianne, is still awaiting trial in Spain for the murder of her two children in 2010.

Mr Barr asked what was the public interest in hacking into the Smiths' emails.

Mr Ryley said: "Martin Smith was a suspected paedophile on the run. Their daughter Rebecca was already on child protection procedures. His wife was running a nursery in Barcelona and Sky News believed and had reasonable grounds for suspecting that if the local authority had done more it might have been able to find out the whereabouts of the family."

Mr Barr read out an email exchange between a reporter and a Sky News editor about whether he should try to hack into Mrs Smith's email.

There are rare occasions where it is justified for a journalist to commit an offence in the public interest Sky News spokeswoman

In it the editor gave the go-ahead, and told the reporter: "Legitimate public interest. Good hunting."

Mr Barr said no story was ever broadcast about the Smiths and Mr Ryley agreed and said they did not find enough evidence of failures by the local authority.

A spokeswoman for Sky News said: "As the head of Sky News, John Ryley, said earlier this month, we stand by these actions as editorially justified.

"The Crown Prosecution Service acknowledges that there are rare occasions where it is justified for a journalist to commit an offence in the public interest.

"The Director of Public Prosecutions Keir Starmer told the Leveson inquiry that 'considerable public interest weight' is given to journalistic conduct which discloses that a criminal offence has been committed and/or concealed."

The Metropolitan Police embarked on its own investigation into computer hacking, and email interception last year.

Operation Tuleta is investigating a number of allegations regarding breach of privacy and a number of people have been arrested and released in connection with the inquiry.