Journalists accused of phone hacking or bribing public officials should be protected by a new “public interest” defence in law, the Labour MP for Holborn and St Pancras has said.

Sir Keir Starmer, a former director of public prosecutions (DPP), used his new position in parliament to argue that current legal protection for journalists was not strong enough and put at risk “an essential foundation of a democratic society”.

His comments come as cases brought against several journalists prosecuted for phone hacking or bribary resulted in acquittals.

This includes Kentish Town resident and former Sun journalist Clodagh Hartley, who was cleared of conspiracy to commit misconduct in a public office in November last year, and Hampstead Garden Suburb resident and ex-Sun news editor John Kay, who was cleared of paying public officials in March.

Ironically, some of the prosecutions against journalists were launched under Sir Keir’s tenure as DPP from 2008 to 2013.

In a debate on Monday on the freedom of the press, organised by the London Press Club, the now MP Sir Keir said: “The time has come for a new law governing this difficult and controversial area. That law needs to be clear and simple.

“Journalists and editors should not need a lawyer on hand 24/7 when they go about their business. A new law should clearly establish a public interest defence.”

Some criminal offences already carry a “public interest” defence, such as under the Data Protection Act 1998 when obtaining or disclosing personal data, but other offences do not.

While as DPP in 2012, Sir Keir issued guidelines for prosecutors when assessing cases involving journalists.

Key to this was whether “the public interest in what the journalist was trying to achieve outweighed the overall criminality”.

Sir Keir hopes to go further with this to be cemented in law.

He did not, however, tell his fellow speakers – including Trevor Kavanagh, associate editor for The Sun – he was against the recent cases brought against journalists.

While saying some offences “have an express public interest defence”, he said that “some did not”.

He added: “The Leveson Inquiry concluded that victims of press abuse need greater protection. I agree with the conclusions. However, journalists’ rights also need protecting.”