The Sun’s royal correspondent, Duncan Larcombe, has vowed to fight with “every breath” charges connected to alleged payments for stories about the royal family from a public official and his wife at the Sandhurst military college.

After a short hearing at Westminster magistrates’ court in central London yesterday, Larcombe’s solicitor, James MacWhirter, said the journalist had worked regularly with the royal family over his 12-year career at the Sun and had risked his life covering the war in Afghanistan.

The solicitor added that Larcombe hoped to prove he always reported in the public interest.

Reading a statement on Larcombe’s behalf outside the court, MacWhirter said: “I wish to make clear I am saddened and disappointed to be charged with these offences ... I hope to demonstrate that I am a responsible journalist who reported in the public interest.”

Larcombe has been charged over allegations that he paid £23,000 to an army sergeant and his wife. He is accused of making 34 payments to John Hardy and Claire Hardy, between February 2006 and October 2008 for stories about the royal family.

The usually dry court room proceedings were enlivened by the presence of about 25 Sun journalists and friends of four colleagues, including the Sun’s executive editor Fergus Shanahan, who was also in court over charges relating to the London Metropolitan police’s Operation Elveden investigation into alleged illegal payments to public officials by newspapers for stories.

Among those in the packed gallery were Sun columnist Trevor Kavanagh, agony aunt Deirdre Saunders and Times business editor Ian King, who was formerly the business editor of the Sun.

Also there were Lorna Carmichael, the head of promotions at the Sun, the online news editor Vince Soodin, reporter Anthony France and senior Sun executives Geoff Webster and Graham Dudman.

Hardy was a colour sergeant based at the Royal Military Training Academy in Sandhurst, where Prince Harry and Prince William trained. At the time of the alleged payments Larcombe was the Sun’s chief royal correspondent.

Shanahan was first of the defendants to appear in court yesterday. He has been charged with an offence of conspiring to commit misconduct in public office in relation to allegations that between 2006 and 2007 he authorised one of his journalists to make two payments totalling £7,000 to a public official for the disclosure of information. The second defendant was Tracy Bell, 34, who was employed by the ministry of defence as a pharmacy assistant at Sandhurst Medical Centre and is charged with misconduct in a public office.