Boris Johnson has avoided a criminal prosecution over comments he made during the EU referendum campaign about the UK sending £350m a week to Brussels after winning a high court challenge.

The district judge Margot Coleman issued the Conservative MP with a summons on 29 May to attend Westminster magistrates court and face three allegations of misconduct in public office.

After a hearing at the Royal Courts of Justice in London on Friday, however, Lady Justice Rafferty and Mr Justice Supperstone overturned the decision.

Marcus Ball, 29, who claimed Johnson had lied during the 2016 referendum campaign, crowdfunded more than £300,000 online to bring a private prosecution.

Rafferty said: “We are persuaded, Mr Darbishire [Johnson’s QC] so you succeed, and the relief that we grant is the quashing of the summonses.”

The judges said the reasons for the court’s ruling would be given at a later date.

Jason Coppel QC, for Ball, had argued there was a “significant constitutional right” for a person to make a private prosecution and only in exceptional cases was a magistrate’s decision overturned.

He argued that while Johnson was the mayor of London he had made an “official case for leaving the EU and used staff and expenses to assist in campaigning”.

He said quashing the summons could allow “well-funded defendants to knock out proceedings before it started”.

Coppel said it was wrong for Johnson to make “false statements” and “as mayor and MP, the office-holder should conduct himself honestly”.

He argued that Johnson’s statement during the hustings had had a “direct impact on public trust” in the most high-profile political campaign for a generation.

The £350m figure was emblazoned on the campaign bus used by Vote Leave during the referendum, with the slogan: “We send the EU £350 million a week, let’s fund our NHS instead.”

Darbishire had earlier said there was no example of a similar case. There was “no factual example from common law in the world, let alone English authority”, he said.

He also questioned whether comments Johnson made during a hustings event amounted to a breach of duty or an abuse of power. He said no complaint had been made to any disciplinary bodies, including the Crown Prosecution Service, and claimed that Ball’s plan was to disrupt Brexit.

The private prosecution was “politically motivated hence vexatious”, he said.

Following the hearing, Ball said: “We have just given the green light for every politician to lie to us about our money for ever. That is a terrifying idea.

“I would ask you, please, all members of parliament, all elected representatives, understand you cannot lie to the public about their money.”

He said he would wait until the judges provided their reasons for throwing the case out before deciding his next move.