INDIANAPOLIS — A federal judge has ruled that Indiana law cannot dismiss mail-in ballots that don't arrive at county election offices by noon on Election Day.

The decision issued late Tuesday orders state election officials to count mail-in ballots if they are postmarked on or before Nov. 3 and received by voting offices no later than Nov. 13.

It comes as county election officials are preparing coronavirus precautions for in-person voting on Nov. 3 while handling a surge in mail-in ballots. The Republicans who control state government have largely resisted calls from Democrats and voting rights groups to ease limits on who can cast mail-in ballots and change the noon Election Day deadline for their arrival.

U.S. District Judge Sarah Evans Barker rejected arguments from state attorneys that extending the deadline would confuse voters, add strain to county election staff and delay the completion of vote counting.

Barker, who was nominated a judge by President Ronald Reagan in 1984, ruled that thousands of people voting by mail because of the coronavirus pandemic faced having their votes not be counted because of slow mail delivery and other factors. The law's main exception to the noon deadline has been for ballots sent from overseas by military members.

"Election Day is set by law as November 3 all day on November 3 until the polls officially close," Barker wrote. "Any voter casting a ballot has the right to do so within that time frame. The noon Election Day receipt deadline disadvantages — indeed, disenfranchises — voters who vote by mail-in ballot by cutting short the time period within which they are permitted to exercise this right even though, due to the COVID-19 pandemic, ensuring the timely delivery of their ballots is outside their control."

The lawsuit filed by Common Cause Indiana and the Indiana State Conference of the NAACP said about 1,500 ballots in Marion County, which includes Indianapolis, and 400 in Hamilton County were rejected for this year's primary election because they arrived after the noon deadline.

Nearly 410,000 Indiana voters had already requested mail-in ballots through Tuesday, some five weeks ahead of Election Day, compared with about 155,000 total mail-in ballots cast for the 2016 presidential election, according to the Indiana secretary of state's office, which oversees state election policy. About half of the ballots in Indiana's June primary were cast by mail.

The secretary of state's office declined to comment on Barker's ruling. The state attorney general's office, which is defending the election law, said it was reviewing the decision and considering its next step. Both offices are controlled by Republicans.

The federal appeals court in Chicago this week upheld a judge's decision ordering six-day extension for counting absentee ballots in Wisconsin, meaning that ballots postmarked on or before Nov. 3 will be counted as long as they are received by Nov. 9.

Barbara Bolling-Williams, the Indiana NAACP president, said the decision protects the rights of those voting by mail.

"Before this ruling, if your ballot was delivered to the Election Office at say 12:10 p.m. instead of the noon deadline on Election Day, your ballot would have been rejected," Bolling-Williams said. "Voting absentee by mail is a safe and now certain option for voters."

Hamilton County Clerk Kathy Kreag Williams said the decision could delay when it is clear which candidate has won races, as her office in suburban Indianapolis could have hundreds of ballots arrive after Election Day.

Williams, who was a key writer of state voting laws during more than 20 years as a Republican legislator, said she supported the deadline as a way to bring closure to an election.

"I truly believe that day is Election Day and that should be it," she said. "It is like any deadline if you move it three or four days, then you are still going to have people who are going to wait until then and it's going to be late."

Another federal judge last month rejected an attempt to force Indiana election officials to allow all voters to cast their ballots by mail because of the pandemic.

Republican Gov. Eric Holcomb and other GOP leaders have turned aside calls from Democrats and others to lift Indiana's mail-in voting limits, which allow people to vote by mail only if they fall into one of several categories, including being 65 or older or being absent from their home counties on Election Day.