Residents of Kansas, Georgia and Alabama will have to prove they are U.S. citizens when registering to vote for federal elections using a national form, a judge ruled Wednesday.

U.S. District Judge Richard Leon sided against a coalition of voting rights groups that sued a U.S. elections official who changed the proof-of-citizenship requirements on the federal registration form at the request of the three states and without public notice. Residents of other states only need to swear that they are citizens, not show proof.

The judge refused to issue a temporary injunction sought by voting rights advocates to overturn the move by Brian Newby, the executive director of the U.S. Election Assistance Commission, until the case can be decided on its merits at trial. The decision is expected to be appealed.

Newby took the top job in November at a government agency entrusted with making voting more accessible, and then months later used the federal position to implement the obstacle to voter registration in three states.

The judge called the breadth of the preliminary injunction that was sought “truly astonishing,” saying the groups are asking the court to void Newby’s actions, order the EAC to reverse the changes he made to the federal form and withdraw Newby’s letters granting the states’ requests.

“These demands are dramatized all the more by the fact the United States Department of Justice has somehow decided to consent to such remarkable relief!” Leon wrote. He also called it “a thinly veiled request” for what’s normally accorded in a final judgment.

The American Civil Liberties Union of Kansas declined comment, and Kansas Secretary of State Kris Kobach, who intervened in the lawsuit on Newby’s behalf, did not immediately respond to an email or phone messages.

The U.S. Supreme Court has said that states must accept and use the federal voter registration form, and an appeals court ruled in 2014 in a lawsuit filed by Kobach that states could not force the commission to require residents to provide proof-of-citizenship documents on the national form.

Leon said that “what lies at the heart of this case are the scope of the authority and the legality of the actions of an independent federal agency that is represented here by Executive Branch counsel who, for the most part, decline to defend it.”

Newby contends he had the administrative authority to grant the request from the three states to add the documentary proof of citizenship requirements on the federal registration form used for their residents.

But voting rights advocates were stunned by Newby’s February action, saying it flies in the face of the commission’s mission to provide a simple, easy form to encourage voter registration. The groups argue the proof-of-citizenship requirements hurt their ability to conduct voter registration drives and deprive eligible voters of the right to vote in federal elections.

The little-known commission was created in 2002 to help prevent a repeat of the disputed 2000 presidential election between George W. Bush and Al Gore following voting chaos in the crucial state of Florida. Among the commission’s duties is oversight of the national voter registration form. The federal body is supposed to have two Republican and two Democratic commissioners but has only one Democrat now because of a vacancy.

The government has already conceded in a court filing that Newby and his agency likely cannot win the lawsuit on its merits because he never determined, as required by the National Voter Registration Act, that the documents were “necessary” to determine the eligibility of voters. The government noted that when Congress enacted the National Voting Registration Act it considered and specifically rejected requiring proof-of-citizenship documents when registering to vote.

Newby is a former Kansas election official who was appointed to his state job by Kobach. As a Kansas official, Newby had publicly supported the state’s efforts to modify the federal form.