Phone hacking uncovered a claim that Prince Harry had broken rules at military training academy Sandhurst by asking an aide for help with an essay, the prosecution claimed.
Prosecutor Andrew Edis QC told jurors at the Old Bailey that a story in the News of the World came from a voicemail that was illegally accessed by private investigator Glenn Mulcaire on behalf of the tabloid's former royal editor Clive Goodman.
It is claimed that the then editor Andy Coulson was also aware of what was happening.
Mr Edis said the story, published on December 18, 2005, was one of a number of stories cited by Goodman as he tried to justify paying Mulcaire a weekly retainer.
The prosecutor said the story, which ran under the headline "Harry's aide helps out on Sandhurst exams", had "got into the paper and was based entirely on a voicemail."
Paul Davis was in the Old Bailey today.
The court heard that former News International chief executive Rebekah Brooks authorised a journalist at The Sun to pay a member of the armed forces for a picture of Prince William dressed in a bikini.
In June 2006, she was asked to authorise a cash payment of £4,000 for the picture of the royal, who was at a party dressed as a Bond girl, the court was told.
Mr Edis said an email from the journalist was forwarded to Brooks, which said: "My best contact at Sandhurst who has provided some great stuff over a period of months is offering us a picture of William at a James Bond party dressed as a Bond girl.
"He is wearing a bikini and an open Hawaiian shirt."
As he continued to outline the case on the third day of his prosecution opening, Mr Edis told the court how Coulson had ordered "do his phone", as the newspaper tried to investigate a story about Calum Best.
The court heard that Best, son of footballer George Best, was allegedly targeted by the NotW as it tried to investigate claims that he had fathered a child with a woman called Lorna Hogan.
As Coulson discussed the story with former head of news Ian Edmondson, he told him: "Do his phone."
Coulson is also accused of authorising payment for a stolen royal phone directory used to target Prince Charles’ top aide, who the News of the World thought (wrongly) was having an affair.
The court heard that the paper made a cash payment for a telephone directory with all of the home numbers of the royal family and their household staff. The prosecutor, Mr Edis said the telephone directory was used for phone hacking.
Throughout the day Mr Edis built his case against the eight defendants, singling out Brooks and Coulson for their alleged role in sanctioning the methods used by the journalists.
Mr Edis referred to a file of emails stored by Royal Editor Cliver Goodman, who was jailed for phone hacking and dismissed in 2007, which showed that his actions were "officially sanctioned by people senior to him."
The prosecution said the paper had three ways of investigating stories - phone hacking, surveillance and confrontation. Mr Edis said phone hacking was used as a "perfectly rational but entirely illegal system" for standing up a story.
All eight defendants deny the charges, and the trail will resume next week.