A U.S. District Court judge ruled Wednesday that Arizona and Kansas can require anyone registering to vote to prove their citizenship and the federal Election Assistance Commission cannot block them.

The ruling is a boost for states’ rights and marks a setback for President Obama and other liberals who fought stiffer voter ID checks with an argument that they reduce voter turnout.

“This is a huge victory for me, personally, for the states of Kansas and Arizona, and for the whole cause of states’ rights,” said Kansas Secretary of State Kris W. Kobach, who led the challenge. “We’ve seen so many defeats recently in areas where the federal government has been encroaching on states’ authorities, and this time the good guys won.”

PHOTOS: Awesome rifles: The best and the baddest

In his ruling, Judge Eric F. Melgren said the EAC, which Congress created after the 2000 Florida voting fiasco, must accede to states’ requests for people to provide proof of citizenship when they register to vote.

The judge said the Constitution gives states the power to determine voter qualifications, and if states want to insist on proof of citizenship, the election commission cannot overrule them.

“The EAC’s nondiscretionary duty is to perform the ministerial function of updating the instructions to reflect each state’s laws,” Judge Melgren ruled in a decision out of Kansas. “The court orders the EAC to add the language requested by Arizona and Kansas to the state-specific instructions of the federal mail voter registration form immediately.”

A spokesman for the EAC said the commission was reviewing the decision. The Justice Department, which argued the case before Judge Melgren, didn’t return a message seeking comment.

The ruling comes at a time when both Democrats and Republicans are paying increasing interest to the rules governing campaigns and voting. With the country ideologically split, each side is looking for an advantage at the ballot box.

Democrats say identification checks could prevent some eligible voters from casting ballots. Republicans generally argue for stiffer checks to prevent fraud.

Kansas and Arizona enacted requirements that voters prove their citizenship when they register. State registration forms were changed to add the requirement.

But the federal government, which also distributes voter registration forms in states under the 1993 National Voter Registration Act, or motor-voter law, refused to add the requirement.

Arizona then said it would refuse to process federal forms and ended up in court. Last year, in a case known as Arizona v. Inter Tribal Council of Arizona, the Supreme Court ruled that Arizona couldn’t reject the federal forms.

But the Supreme Court ruling also hinted that if states asked the EAC to include proof of citizenship on forms distributed within their borders, the commission couldn’t refuse.

Arizona and Kansas requested that the EAC change the forms distributed in those states, but the commission refused.

Judge Melgren said he saw clear signs in last year’s Supreme Court ruling that the justices intended for the EAC to follow the wishes of the states.

“On one hand, the ITCA decision acknowledges the broad scope of Congress‘ power under the Elections Clause, which includes the authority of the NVRA to preempt state law regarding voter registration,” the judge wrote. “But the ITCA opinion also emphasizes the states’ exclusive constitutional authority to set voter qualifications — which Congress may not preempt — and appears to tie that authority with the power of the states to enforce their qualifications.”

Arizona Secretary of State Ken Bennett said the ruling will help clean up voter rolls. About 2,000 people have submitted federal forms in the state but haven’t proved their citizenship, he said.

“With this filing and with this ruling, we have accomplished what we felt was the desire of Arizona voters all along,” Mr. Bennett said.

Wednesday’s ruling was focused on election law, but it comes in the middle of a thorny national debate about U.S. immigration laws. A number of states have pushed for stricter enforcement from the Obama administration and the right to help enforce federal immigration principles.

Mr. Kobach has been at the forefront of those efforts.