A Virginia judge ruled partially in favor of a Republican-led lawsuit that sought to block mail-in ballots arriving after Election Day with missing or unreadable postmarks.

The ruling came in a dispute over whether ballots received up to three days after Election Day still count if the postmarks on them were not clearly identifiable as on or before Nov. 3. The Public Interest Legal Foundation, which filed the lawsuit on behalf Frederick County Board of Elections member Tom Reed, argued that the new rule was in violation of a recent election law. Bob Hess, chairman of the Winchester Republican Committee, was also a plaintiff.

The Republicans argued that the law’s requirements were simple – ballots received after Election Day must have been postmarked before the deadline.

VIRGINIA GOP CHALLENGER CONFIDENT IN CLOSE HOUSE RACE THAT HAS OUTSPENT PRESIDENTIAL CAMPAIGNS

But the state’s Democratic Attorney General Mark Herring’s office called the lawsuit an attempt to “suppress the vote.”

The state instructed local officials to still count ballots with missing or illegible postmarks so long as a barcode on the envelope confirmed it had been mailed before the deadline.

If the barcode was inconclusive, election officials were told to look inside and check the date written next to voter’s signature. But lawyers for the plaintiffs argued was insufficient evidence of when it actually was mailed.

The judge ruled that if a barcode didn’t confirm a ballot with a missing postmark actually was mailed, it wouldn’t count, regardless of what was written inside. A ballot postmarked illegibly could still count, as long as the voter signed it before Election Day.

"There was a big win for election integrity and the rule of law in Virginia yesterday," said Rich Anderson, chairman of the Republican Party of Virginia. "In a lawsuit brought by two of our grassroots Republicans, the Frederick County Circuit Court told the Attorney General and the State Board of Elections what we all know - the law means what it says."

CLICK HERE TO GET THE FOX NEWS APP

Early in-person voting is allowed until Oct. 31, according to the Virginia Department of Elections.

The Associated Press contributed to this report.