Conservative Party leadership favorite Boris Johnson won a UK court ruling that ends an attempt to prosecute him over now infamous claims on the side of a campaign bus during the 2016 Brexit referendum.

The decision removes a potential smear on Johnson’s campaign to become Britain’s next prime minister ahead of the crucial first round of voting in the Tory leadership election next week. He has said the party faces extinction if it doesn’t deliver Brexit by the October 31 deadline, and that he would be willing to leave the EU without a deal if necessary.

Two judges on Friday quashed an order that would have required the politician to appear in court for an unprecedented private prosecution for the offense of misconduct in public office. The member of Parliament was last month ordered to answer questions that he made false claims about British spending on the European Union.

Johnson’s team argued that he was merely campaigning when he said that the U.K. sent 350 million pounds ($445 million) a week to the EU -- one of the central tenets of the Brexit debate. The spending claim was cited repeatedly and painted on the side of the Vote Leave bus. The core claim of the Vote Leave campaign was discredited during the campaign by the House of Commons Treasury Select Committee, which called it “highly misleading”

Judges Anne Rafferty and Michael Supperstone issued the decision after hearing a challenge from Johnson’s legal team who said the prosecution was the culmination of a “politically-motivated” process. The judges overturned a lower court ruling that Johnson had a case to answer.

The spending claim was just a political claim open to -- and available to -- contradiction, Johnson’s lawyer Adrian Darbishire said at the hearing.

comment COMMENT NOW