DES MOINES, Iowa (AP) — A Democratic candidate for a northeast Iowa House seat who trails the Republican incumbent by nine votes won a court ruling Monday that gave her the right to determine whether 33 absentee ballots that have not been counted were mailed on time.

Democrat Kayla Koether sued Iowa Secretary of State Paul Pate and Winneshiek County Auditor Ben Steines on Thursday after they refused to count the ballots in her race against Republican state Rep. Michael Bergan, saying the envelopes lacked a postmark that would indicate when they were mailed.

Judge Scott Beattie ordered officials to preserve the ballots and determine whether they were mailed on time. But he did not rule on whether the ballots would ultimately be counted, saying that issue could be argued in court later.

State law says absentee ballots must be mailed no later than the day before the election to be counted. For ballots that arrive after Election Day, the law says officials can use either the postmark or an "intelligent mail barcode" to determine whether it was mailed on time.

At issue is what exactly lawmakers meant by an "intelligent mail barcode."

Koether's attorney Shayla McCormally argued in court that Iowa law does not define that phrase. Koether says the ballots in question have a postal bar code that might show when they were mailed.

But Pate and Steines argue that an "intelligent mail barcode" is a code that a county election official would place on the envelope. Only six of Iowa's 99 counties use such a bar code to track absentee ballots.

"Absentee ballots that arrive after Election Day and do not contain postmarks, nor a county-specific Intelligent Mail Barcode, are not eligible to be counted," Pate said.

That may be shocking news to the more than 547,000 Iowans who voted absentee, a record number for the state in an election with the highest ever turnout in a midterm election of 1.3 million voters. Iowa officials acknowledge that the Postal Service does not put postmarks on all ballots, but it's not clear how many ballots statewide might not have been counted because they lacked postmarks. A spokesman for Pate said the office does not know.

Beattie's order requires Steines to work with the Postal Service to determine whether the postal bar codes contain the date ballots were placed in the mail and if so, the information must be provided to the court and attorneys by Friday. Beattie's order said it can be argued in court later whether the postal bar code is appropriate to be used to determine the validity of the votes.

"Failure to read the barcodes could result in ballots that were validly cast being ignored," he said.

Bergan leads Koether by nine votes out of 14,000 cast in the northeast Iowa district that includes Clayton, Fayette and Winneshiek counties.

Bergan said he hadn't seen the judge's ruling and had no immediate comment.

Koether said the judge's ruling "is good news for the 33 Iowans who cast their ballots in good faith and deserve to have their votes counted."

Democrats picked up five House seats in the November election to narrow Republican control 53 to 46 excluding the District 55 seat.