Four senior Sun journalists were motivated by a greed for exclusives in paying thousands of pounds to public officials for information including “tittle-tattle and gossip” about Princes William and Harry, the Old Bailey has heard.

Deputy editors Fergus Shanahan and Geoff Webster, former chief reporter John Kay and chief royal correspondent Duncan Larcombe paid huge sums for “salacious or embarrassing” material and morbid stories about British troops in Afghanistan and Iraq, jurors were told on Wednesday morning.

Opening the trial, prosecutor Michael Parroy QC said the journalists felt “able to act with impunity” by believing that the illegal payments would never come to light. “For the journalists, it was the prospect of a story that would appear in the newspaper as an ‘exclusive’ or ‘scoop’,” he added.

“For the management of the newspaper, it was the prospect of a boost in sales, an advantage in the daily competition with other newspapers for readership, increased circulation figures and profitability.”

Alongside the journalists in the dock were former Sandhurst army officer John Hardy and his wife Claire Hardy.

John Hardy is accused of receiving £23,714 in backhanders between February 2006 and October 2008, mainly for stories about Princes William and Harry, who trained at Sandhurst Military Academy. He is alleged to have funnelled £7,900 of unlawful payments from the Sun through his wife’s bank account.

Parroy told jurors that the information being leaked by the public officials was often “simply prurient, morbid or banal”, without a public interest.

“Tittle-tattle and gossip about the royal Princes William and Harry had a special value, as did tit-bits involving salacious or embarrassing conduct,” he said. “The other recurring theme is personal tragedy in the battlegrounds of Helmand Province [in Afghanistan] and Iraq.”

He added: “The public interest in such stories and involving such personal and private matters was often, you may conclude, marginal or non-existent.”

Parroy told jurors that John and Claire Hardy were not motivated by some “heartfelt and right-minded indignation” at an injustice that needed exposing in the press.

He told jurors: “These were not whistleblowers honourably bringing to the attention of the press and public some terrible wrong that they had discovered as a result of their occupation and disclosed for honest and proper motives.

“These were people who were motivated, quite simply, by greed. Self-enrichment was what they were seeking regardless of the cost to others personally or for the public interest which they were employed effectively to defend.”

Kay, Shanahan, and Webster, deny a charge of conspiring with former Ministry of Defence official Bettina Jordan-Barber to commit misconduct in public office between 2004 and 2012.

Webster denies a separate charge of conspiring with an unnamed army officer to commit misconduct in public office between 3 November 2010 and 6 November 2010.

Larcombe, John Hardy and Claire Hardy deny being involved in misconduct in public office between 9 February 2006 and 16 October 2008.

The jury was told that Kay, a highly regarded journalist with a career at the Sun spanning 40 years, paid trusted Ministry of Defence official Bettina Jordan-Barber a total of £100,000 for stories between 2004 and 2012.

Kay referred to Jordan-Barber as his “number one military contact” in emails requesting authorisation for payments to her, the court heard. She had Kay’s number on her mobile phone under the name “Godfather J”.

The vast majority of the £100,000 in payments were paid to Jordan-Barber in cash via a Thomas Cook transfer, the court heard, and many were approved by either deputy editors Webster and Shanahan or Rebekah Brooks, who was editor at the time.

Parrow told jurors that Brooks was acquitted of conspiring to commit misconduct in public office and that they should disregard that verdict in considering this case.

The trial, before Mr Justice Saunders, is due to last three months.