LONDON — Boris Johnson, the favorite to replace Theresa May as British prime minister, must appear in court over allegations he lied to the public about Brexit, a judge ruled Wednesday.

The former foreign secretary and ex-London mayor was ordered to answer a private summons alleging he committed three offences of misconduct in a public office.

These relate to claims that the New York-born Johnson made in the run-up to and aftermath of the 2016 Brexit referendum when he was one of the leading campaigners for Britain to leave the European Union.

The application against Johnson alleged he "repeatedly lied and misled the British public as to the cost of E.U. membership, expressly stating, endorsing or inferring that the cost of E.U. membership was £350 million ($442 million) per week."

The £350 million figure was a central and controversial part of the pro-Leave campaign’s "Take back control" message, famously emblazoned across a campaign bus. Opponents argued that it was deliberately misleading and it became symbolic of the divisions caused by the referendum.

In her written ruling, District Judge Margot Coleman said the allegations were not proven and she had made no finding of fact, but said Johnson should face trial.

"Having considered all the relevant factors I am satisfied that this is a proper case to issue the summons as requested for the three offences as drafted," Coleman said. "This means the proposed defendant will be required to attend this court for a preliminary hearing, and the case will then be sent to the Crown Court for trial."

Johnson's spokesman was not immediately available for comment.

In submissions to London's Westminster Magistrates' Court, Johnson's lawyers said the application was a stunt launched for purely political purposes.

"It is submitted that the facts alleged by the applicant do not come close to establishing a qualifying breach of duty," his lawyer argued. "None of the acts complained of took place in the course of Mr. Johnson's direct parliamentary or mayoral duties, but in the course of political campaigning."