The commission had fined Vote Leave and Brexiter Darren Grimes after the group donated £620,000 to the campaigner.
Both Grimes and Vote Leave claim they were acting on the advice of the Electoral Commission, which initially said it found nothing wrong with the payments, but later fined the pair, and referred Grimes to the police.
Today however, Lord Justice Leggatt said the commission had misunderstood the Political Parties, Elections and Referendum Act’s definition of ‘referendum expenses’.
"The source of its error is a mistaken assumption that an individual or body which makes a donation to a permitted participant cannot thereby incur referendum expenses,” he said in his judgement.
“As a result of this error, the Electoral Commission has interpreted the definition in a way that is inconsistent with both the language and the purpose of the legislation.”
Vote Leave paid the donations directly to Canadian firm Aggregate IQ on Grimes’ behalf, for work it performed on Vote Leave’s campaign.
The Electoral Commission should have counted these payments towards Vote Leave’s overall referendum expenses, Leggatt said.
The commission argued that this wasn’t a valid conclusion, because Vote Leave could have paid the money to Grimes directly, for him to pay Aggregate IQ, claiming this wouldn’t constitute a breach of spending rules.
But the judge said this would only have been true had Vote Leave sent Grimes the money without an agreement that he must use it to pay Aggregate IQ.
An Electoral Commission spokesperson said: “The Commission welcomes the court’s consideration of this aspect of electoral law.
“The court arrived at the same conclusion as the Commission did in its investigation – that Vote Leave should have accounted for the expenditure on the digital services firm, Aggregate IQ – although it found an additional reason for reaching that conclusion.
“The Commission imposed sanctions on Vote Leave for this offence and others found during the investigation.”
Jo Maugham, QC of the Good Law Project, which brought the case to the High Court, said: “The body in charge of ensuring the referendum was fair ensured it was unfair. Second, Vote Leave broke the law twice over. It broke the law – as the EC has already found – by ‘working together’ with Darren Grimes. The EC never permitted working together. But it also broke the law by acting on the basis of the Electoral Commission’s unlawful advice.”
“Heads must roll [at the commission],” he added.
Writing on Brexit Central, former Vote Leave boss Matthew Elliott said: “We find ourselves in a complete Alice in Wonderland situation. Vote Leave asked for, and received, the Electoral Commission’s advice.
“We followed that advice. During the judicial review, the Electoral Commission tried to avoid admitting that it had given that advice to us, but we were able to establish that they had – and the judges clearly ruled in the preliminary hearing that we had received that advice. Yet we are now told that, by having followed that advice, we broke the law.”