Kate Middleton, Prince William
Prince William called Kate Middleton 'babykins' in a voicemail, court hears.Reuters

Kate Middleton's phone was hacked by the News of the World before she married Prince William, the Old Bailey has heard.

In a voicemail left for Kate, William tells her about an army training exercise he had just finished.

During the call, the Duke of Cambridge told Kate how he almost got shot and that it would have been "embarrassing" if he had.

He said: "Hi baby. Um, sorry, I've just got back in off my night navigation exercise.

"I had a busy day today again. I've been running around the woods of Aldershot chasing shadows and getting horribly lost, and I walked into some other regiment's ambush, which was slightly embarrassing because I nearly got shot.

"Not by live rounds but by blank rounds, which would have been very embarrassing, though."

In another call, William refers to Kate as "babykins", the prosecutor Andrew Edis said while reading a transcript.

The recordings of the calls were discovered in the home of the newspaper's former royal editor Clive Goodman and Glenn Mulcaire, a private eye who was working for Rupert Murdoch's tabloid in 2006.

The court also heard extracts of a recording left on Prince Harry's phone, in which an unknown male put on a high-pitched voice and pretended to by Chelsy Davy, Harry's then girlfriend. In the call, the male calls Harry ginger.

In 2007, Goodman and Mulcaire both admitted to hacking the telephones of royal aides by accessing voicemail messages. They were sentenced to four and six months respectively.

Mulcaire has pleaded guilty to further phone-hacking charges.

An internal News of the World email later sent by Goodman to colleagues subsequently helped identify a resulting story for the paper, telling them "William shot in ambush".

The trial continues.