A phone message left by Prince William for Kate Middleton to arrange a date was intercepted by a News of the World private investigator, the hacking trial has been told.
The message, recorded by Glenn Mulcaire, was of William arranging to leave Sandhurst to meet his then girlfriend, the Old Bailey heard.
It was found on a micro-cassette in former royal editor Clive Goodman's flat.
Goodman, 56, was giving evidence about the recording during his third day in the witness stand.
His lawyer, David Spens QC, read out part of a police transcript of the tape dated February 23, 2006.
In it, William says: "Hopefully I should be able to leave by seven at the latest."
Spens asked Goodman: "How did this voice message from Prince William to Kate Middleton come to be on a micro-cassette?"
Goodman replied: "This was originally recorded by Glenn Mulcaire."
Mulcaire was jailed for six months in 2007 for intercepting phone messages from Clarence House.
Goodman told the court that he made a personal deal with Mulcaire to pay him £500 a week to get information for hacking the phones of people close to princes William and Harry, which was separate from the newspaper's contract.
He gave the private investigator the names of the princes' personal assistant, private secretary and also the Prince of Wales's head of press.
Spens said: "Was there any advantage to you in giving him the names of these three people?"
He replied: "I would be able to access information about meetings, events, events happening in the lives of the Prince of Wales's sons, who were then up and coming and making their way in the world."
His deal with Mulcaire was only meant to last a couple of months from October 2005 but continued until the time of their arrests in August 2006, he said.
Goodman admitted phone hacking and was sentenced in 2007. He denies conspiring to commit misconduct in a public office.
Other defendants, including former News of the World editors Rebekah Brooks and Andy Coulson, also deny the charges against them.
The trial continues.