The pro-Brexit campaigner Darren Grimes has succeeded in his attempt to overturn a £20,000 fine for electoral spending offences during the EU referendum.

In a two-hour judgment delivered at the Central London county court, Judge Marc Dight said the Electoral Commission had set too high a threshold for determining whether Grimes’s campaign group, BeLeave, was a genuine organisation for the purposes of electoral law.

Dight ruled that the commission’s notice imposing the fine should be withdrawn. He added that even if Grimes had committed the offence, it would not have justified the fine of £20,000, the maximum possible under current law.

After the ruling, Grimes said: “I am delighted and relieved that the court has found me innocent.

“This case has taken a huge toll on myself and my family, and I’m thankful it’s now over. I will be eternally grateful to all those people who have supported me – your generosity and kind words of encouragement have kept me going.”

On Twitter Grimes attacked the Electoral Commission’s handling of the case, which he said had been based on an “incorrectly ticked box on an application form”. He said the case “raises serious questions about its conduct both during and after the referendum”.

The Electoral Commission said: “We are disappointed that the court has upheld Mr Grimes’s appeal. We will now review the full detail of the judgment before deciding on next steps, including any appeal.”

Scrutiny of Grimes and BeLeave began in the months following the EU referendum after it emerged that Vote Leave, which was approaching its own £7m spending cap, had donated hundreds of thousands of pounds to Grimes.

Grimes spent the money with the digital marketing firm AggregateIQ, the same company used by Vote Leave. It later emerged that Vote Leave had paid the money to the company directly, and that Grimes had recorded the payment as a donation to BeLeave.

In July last year the Electoral Commission concluded that coordinated spending had taken place in breach of the law. Vote Leave was fined £61,000, in part for refusing to cooperate with investigators, while Grimes was fined £20,000.

Both Vote Leave and Grimes launched appeals against their respective fines, although Vote Leave later withdrew its appeal and paid its fine. By contrast, Grimes raised over £90,000 via a crowdfunding website to cover his legal costs.

However, the Electoral Commission decided to levy the fine on Grimes for registering as “Darren Grimes/BeLeave” and describing himself as an individual, rather than a group campaigner, on his registration form. It also argued that BeLeave had not existed before May 2016 for the purposes of electoral law.

As a result Grimes’ appeal at court was fought solely over arcane legal points about the significance of a notification of intent to participate in the referendum, whether Grimes had registered as a campaigner correctly, and the true legal definition of an unincorporated association for the purposes of electoral law.

Dight agreed with Grimes’ counsel that the campaigner had not intended to mislead and had been confused by the Electoral Commission’s registration form.

He further concluded that the commission had failed to satisfy itself beyond reasonable doubt that BeLeave was not a genuine unincorporated association, and therefore was not able to conclude an offence had been committed.

The judge made no comment on Grimes’ allegations of abuse of process by the commission. However he did observe that even had the offence been committed, it would not have warranted the maximum possible fine of £20,000 that the commission chose to impose.