LONDON — Britain’s High Court on Friday threw out an attempt to prosecute Boris Johnson, the top contender to replace Theresa May as prime minister, over accusations that he lied to the public during the 2016 referendum on Brexit.

Mr. Johnson, a former foreign minister, was told last week that he had to address in court three counts of misconduct in public office over his Brexit claims. Those included a message painted on a campaign bus that said Britain paid 350 million pounds, or $440 million, every week to the European Union, money that he said would be injected into the country’s National Health Service after Britain exited the bloc.

Opponents of Brexit say the figure was a wild misrepresentation made to mislead voters. The figure does not account for Britain’s rebate, which is deducted before it sends money to Brussels. Britain’s net contribution to the European Union in April 2016 was about £190 million a week, according to the Office for National Statistics.

On Friday, judges at the High Court in London overturned the earlier decision, meaning that Mr. Johnson would not be called to answer the charges. The High Court did not give a reason for its decision, the BBC reported.