COLUMBUS, Ohio—A federal judge on Tuesday blocked the implementation of new ballot-access rules, saying they unfairly hamper the ability of minor political parties to participate in this year’s elections.

District Court Judge Michael Watson granted a preliminary injunction preventing the state from enforcing the Republican-backed law, which prevents Ohio’s four minor parties from holding a 2014 primary election and strips them of state recognition.

Under the law, minor parties would have to scramble to collect 28,000 voter signatures by next July to regain official recognition. Parties that meet that requirement would then have to submit to the state a list of candidates to appear on the November ballot instead of holding a primary.

In a 28-page opinion, Watson said the law retroactively penalizes minor-party candidates who filed for office before Gov. John Kasich signed the measure into law last November. It also stops minor parties from reaping the political benefits of holding a primary, he said.

“The Ohio Legislature moved the proverbial goalpost in the midst of the game,” the judge wrote. “Stripping plaintiffs of the opportunity to participate in the 2014 primary in these circumstances would be patently unfair.”

Supporters of the new law say it’s needed after a 2006 court ruling found the state's previous standards for minor parties to be unconstitutionally restrictive.

But the Libertarian Party of Ohio, which filed the legal challenge against the law with two other minor parties, claimed Republicans pushed through the changes at the last minute to help Kasich's re-election chances by sabotaging the candidacy of Libertarian gubernatorial candidate Charlie Earl.

Libertarian Party of Ohio officials hailed the ruling and said in a release that Earl and other statewide candidates would meet the state's Feb. 5 filing deadline for primary candidates.

“Once again, the courts stand with us and with the First Amendment rights of all Ohioans to political freedom and suffrage in Ohio,” said Kevin Knedler, chair of the party's executive committee, in a statement.

A spokesman for Secretary of State Jon Husted's office said Tuesday that state officials were still reviewing the ruling and hadn't decided whether to appeal the case.

It's the fourth time in 10 years that Libertarians have successfully challenged Ohio's election law in court.