The former royal editor of Rupert Murdoch's News of the World tabloid has admitted that he had hacked the voicemails of Britain's Prince William and Prince Harry, and William's wife Kate Middleton.

Clive Goodman told the jury at the Old Bailey court in London that he had hacked Queen Elizabeth's grandsons' phones in search of stories while working at the now-defunct tabloid.

Mr Goodman was jailed in 2007 for illegally accessing the voicemails on the mobiles of royal aides.

Ms Middleton's phone was hacked 155 times, William's 35 and Harry's nine times, the court was told.

He targeted Ms Middleton, who married William in 2011, on Christmas Eve, Christmas Day and Stephen's Day in 2005.

Despite her often changing the PIN number to access her voicemails, her phone was repeatedly hacked.

The last time was on 7 August 2006, the day before police arrested Mr Goodman.

William was hacked for the first time in late January 2006, the court heard, the first time it had been revealed that his voicemails had been accessed.

Despite numerous hackings of the royals, Mr Goodman said detectives had never before asked him about his tapping of the princes' phones.

Police reopened their investigation into phone-hacking in 2011.

The subsequent scandal led Mr Murdoch to close the 168-year-old News of the World.

Mr Goodman, 56, is now on trial accused with the paper's former editor Andy Coulson, later Prime Minister David Cameron's media chief, of authorising illegal payments to public officials.

Mr Coulson and Rebekah Brooks, another former editor and later chief executive of Murdoch's British newspaper arm, are also on trial accused of phone-hacking offences.

All seven defendants on trial deny the charges.