TOPEKA, Kan. (AP) — Kansas must count potentially thousands of votes in state and local races from people who’ve registered without providing citizenship documents, a county judge ruled on Friday.

Shawnee County, Kan., District Judge Larry Hendricks makes a comment during a hearing on requiring the state to count potentially thousands of votes in state and local elections from people who've registered without providing proof of their U.S. citizenship, Friday, July 29, 2016, in Topeka, Kan. Hendricks has ruled that the state is required to count all their votes (AP Photo/John Hanna)

Shawnee County, Kan., District Judge Larry Hendricks makes a comment during a hearing on requiring the state to count potentially thousands of votes in state and local elections from people who’ve registered without providing proof of their U.S. citizenship, Friday, July 29, 2016, in Topeka, Kan. Hendricks has ruled that the state is required to count all their votes (AP Photo/John Hanna)

The order from Shawnee County District Judge Larry Hendricks came only four days before Tuesday’s primary election. Hendricks blocked an administrative rule from Kansas Secretary of State Kris Kobach.

The ACLU filed a lawsuit on behalf of three prospective voters earlier this month, a week after a state board allowed Kobach to impose the rule temporarily — through the November election — without a public hearing. It applies to people who register to vote at state motor vehicle offices without providing proof of their U.S. citizenship as required by a 2013 state law.

Dale Ho, the director of the American Civil Liberties Union's Voting Rights Projects, questions a witness during a court hearing on whether Kansas must count potentially thousands of votes in state and local races from people who've registered without providing proof of their U.S. citizenship, Friday, July 29, 2016, in Topeka, Kan. A Shawnee County judge has ruled that the state must (AP Photo/John Hanna)

Dale Ho, the director of the American Civil Liberties Union’s Voting Rights Projects, questions a witness during a court hearing on whether Kansas must count potentially thousands of votes in state and local races from people who’ve registered without providing proof of their U.S. citizenship, Friday, July 29, 2016, in Topeka, Kan. A Shawnee County judge has ruled that the state must (AP Photo/John Hanna)

The affected voters were to receive provisional ballots to be reviewed later, and county election officials are directed to count only their votes for federal offices, not state and local ones. Ahead of the primary, about 17,600 people registered at motor vehicle offices without providing citizenship papers, and the rule could apply to 50,000 people in November.

Kobach’s action was a response to a federal judge’s ruling in May in another lawsuit that people who register at motor vehicle offices are entitled to vote in federal races even if they’ve not met the proof-of-citizenship requirement.

Kansas Secretary of State Kris Kobach listens and takes note as a judge declares in Shawnee County District Court that the state must count potentially thousands of votes from people who registered without providing documentation of their U.S. citizenship, Friday, July 29, 2016, in Topeka, Kan. Kobach had directed local election officials to count only their votes in federal races, not state and local ones. (AP Photo/John Hanna)

Kansas Secretary of State Kris Kobach listens and takes note as a judge declares in Shawnee County District Court that the state must count potentially thousands of votes from people who registered without providing documentation of their U.S. citizenship, Friday, July 29, 2016, in Topeka, Kan. Kobach had directed local election officials to count only their votes in federal races, not state and local ones. (AP Photo/John Hanna)

After the ruling, Kobach said he would not appeal because it was too late before the primary election next Tuesday. But he criticized the judge’s decision.

“It essentially knocks a huge loophole in that law,” he said of its impact on the citizenship requirement.

The ACLU had argued that setting up a two-tiered election system violates the affected voters’ constitutional rights by treating them unequally. Its solution was to allow their votes in all races to be counted.

Kobach, a conservative Republican, has championed the state’s proof-of-citizenship requirement as an anti-election fraud measure. He argues that in complying with the federal judge’s order, he’s still required to enforce the proof-of-citizenship law as much as possible.

Critics of proof-of-citizenship requirements say they suppress voter turnout — particularly among young and minority voters — far more than they combat fraud. Alabama, Arizona and Georgia have similar requirements, but Kansas has gone the furthest to enforce its law.

The Kansas proof-of-citizenship law and its enforcement have been the subject of multiple federal and state-court lawsuits.

A federal law requires states to allow people to register at motor vehicle offices when they’re obtaining or renewing driver’s licenses. States can impose “necessary” registration restrictions, but the federal judge ruled in May that people document their citizenship by signing a statement on the registration form, facing criminal penalties if it’s not true.

___

Follow John Hanna on Twitter at https://twitter.com/apjdhanna