BISMARCK, N.D. (AP) — A federal judge in North Dakota has dismissed a lawsuit challenging the acceptance of mail-in ballots after Election Day brought by a county election official and backed by a legal group aligned with former President Donald Trump.

In his Friday ruling, U.S. District Court Judge Daniel Traynor said Burleigh County Auditor Mark Splonskowski lacks standing to bring the case, and failed to show he was harmed by the law or that his constitutional rights will be violated. The auditor alleged state and federal law conflict as to the counting of mail ballots received after Election Day.

“According to Splonskowski, following his understanding of federal law will inevitably result in criminal prosecution under North Dakota law because he will have to forego his duty to follow North Dakota election law,” Traynor wrote, adding later, “This is deeply concerning to the Court that an elected official openly advocates for violating the law he was elected to enforce because he has independently concluded it contradicts federal law.”

The judge also said the reasoning in Splonskowski’s lawsuit, if successful, “could be utilized against” overseas and military voters’ rights to vote.

“This, indeed, is a concerning position for an elected official to take,” wrote Traynor, who also said Splonskowski should have asked the local state’s attorney for an opinion about the legal conflict he alleged.

“He may wish to do so before the next election as it may avoid his potential prosecution … or removal from office,” the judge said in a footnote citing state laws for those avenues.

North Dakota Republican Secretary of State Michael Howe welcomed the ruling as “a win for the rule of law in North Dakota and a win for our military and overseas voters.” About 29% of North Dakota voters cast their ballots by mail in the November 2022 general election.

In September, the judge had asked the parties whether he should dismiss the case because Splonskowski had no approval from the county commission to sue in his official capacity as auditor. He said he brought the lawsuit against the state’s election director as an individual and not in an official capacity. The judge found otherwise.

Splonskowski, backed by the Public Interest Legal Foundation, filed the lawsuit against the state election director in July. He argued he “faces an impossibility in enforcing the law” around whether to accept mail-in ballots received after election day, alleging federal and state law conflict as to when those ballots must be turned in. He claimed he risks criminal penalties.

Foundation spokesperson Lauren Bowman Bis said, “We are disappointed in the Court’s ruling. We believe unresolved elections undermine confidence and that federal law should be followed.”

North Dakota law allows mailed ballots received after election day to be counted by county canvassing boards, which meet 13 days after the election, but those ballots must be postmarked before the date of the election.

In September, attorneys for the Voting Section of the U.S. Justice Department’s Civil Rights Division filed a statement of interest in the case, saying North Dakota’s law is consistent with federal law, and ensures military and overseas voters have enough time for their ballots to be counted.

The foundation brought voting-related lawsuits in Pennsylvania and Arizona amid Trump’s claims of 2020 election fraud.

Splonskowski was elected in 2022 as the top election official in the county that is home to Bismarck, North Dakota’s capital city.

A similar lawsuit filed last week in Mississippi by Republican entities, including the Republican National Committee, also targets mail ballots received after election day.

Political observers say the efforts would disenfranchise or penalize voters, if successful.