An ex-Clarence House press chief told the trial of the Sun's royal editor that some of the stories to come out of Sandhurst about Princes William and Harry were "intrusive", a court heard.

Former communications secretary Paddy Harverson said while the Sun's coverage was "generally" positive about the young princes' performance during their officer cadet training, it was "important to remember" some stories "should have been private".

Sun journalist Duncan Larcombe is on trial at the Old Bailey over payments to ex-Sandhurst Royal Military Academy instructor John Hardy from Oswaldtwistle, for story tips and photos while Harry and William were officer cadets.

The court has heard how the pair were involved in brokering a £4,000 Sun deal for a photograph of Prince William dressed up for a party as a Bond girl, sporting the swimwear.

Mr Harverson confirmed that then-editor Rebekah Wade, now Rebekah Brooks, personally intervened in negotiations on whether the Sun should publish the photograph.

In the end, the tabloid never made it public and instead ran a story alongside a mock-up image with the Prince's face on it under the headline "Willy in a bikini".

Prosecutor Michael Parroy QC asked Mr Harverson to restrict himself to yes or no answers when he questioned him about the story which ran in the tabloid in September 2006.

He said: "During the summer of 2006, did you have a conversation with the then editor of the Sun, Rebekah Wade?"

The witness replied: "Yes."

The lawyer said: "Was that conversation in connection with possibly printing a photograph somewhere along these lines?"

Mr Harverson said: "Yes."

Mr Parroy went on: "Did you express to her your view about the appropriateness of the photo being published?"

Mr Harverson agreed and confirmed that he did take a note of the conversation he had with the then Ms Wade.

Under cross examination by Larcombe's lawyer Richard Kovalevsky QC, Mr Harverson confirmed occasions when he had a good working relationship with the reporter in the past.

On one occasion they had met at the Garrick Club in London to brainstorm ideas on how to deal with the operational and security difficulties surrounding Prince Harry's deployment to the front line in Afghanistan.

The result was that the Sun, along with the rest of the UK media, agreed not to report anything that might put the prince's tour at risk.

Prince Harry was forced to return home after the news embargo was broken by media in Australia and the United States, the court heard.

Until May 2013, Mr Harverson was communications secretary to the Prince of Wales and was also responsible for media at Clarence House involving the Duchess of Cornwall, Princes William and Harry and the Duchess of Cambridge.

Former Colour Sergeant Hardy is charged with misconduct in a public office between February 9 2006 and October 16 2008.

His wife Claire Hardy is charged with aiding and abetting and Larcombe is charged with aiding, abetting, counselling and procuring Hardy in the offence.

They are in the dock alongside chief reporter John Kay, executive editor Fergus Shanahan and deputy editor Geoffrey Webster, who are charged with conspiring with each other and Ministry of Defence official Bettina Jordan-Barber to commit misconduct in a public office between January 1 2004 and January 31 2012.

Webster also faces a second count of conspiracy to commit misconduct with a serving officer in the armed forces between November 3 and November 6 2010.

Kay, 71, of Golders Green, north London; Larcombe, 39, of Aylesford, Kent; Webster, 55, of Goudhurst, Kent; Shanahan, 59, of Felsted, Essex; and John Hardy, 44, and Claire Hardy, 41, deny the charges against them.

The trial continues.