JACKSON, Miss. (AP) — A federal judge on Tuesday dismissed a lawsuit accusing Mississippi of using a discriminatory proof-of-citizenship requirement for some new voters under a law dating back to the Jim Crow era.

The dismissal came weeks after the state repealed a 1924 law that required naturalized citizens, but not people born in the U.S., to provide proof of citizenship when registering to vote.

A new law enacted in its place has also drawn opposition but is being grudgingly accepted by voting rights groups who say it ultimately should protect naturalized citizens from being incorrectly marked as noncitizens when they register to vote.

The secretary of state had been running names of potential new voters through a state Department of Public Safety database of people with Mississippi driver’s licenses and identification cards. Voting rights advocates said this practice disproportionately hurt people of color by flagging them as possible noncitizens.

The new law says that if the public safety database raises questions about citizenship, the potential new voter’s name must be run through a federal immigration database. Groups that advocate for voting rights and immigrants’ rights said the federal database provides a safeguard to protect naturalized citizens from being incorrectly marked as noncitizens when they register to vote.

“We would prefer that there be no database matching,” Rob McDuff, an attorney for the Mississippi Center for Justice said in a news release Tuesday. “There is no problem in Mississippi with non-citizens trying to vote. But given that the secretary of state created such a database matching program, (the new law) makes the situation better and decreases the number of erroneous non-matches.”

Two groups, Lawyers Committee for Civil Rights Under Law and the Mississippi Center for Justice, sued the state in 2019 on behalf of the Mississippi Immigrants Rights Alliance and the League of Women Voters of Mississippi.

“No state in the United States other than Mississippi subjects naturalized citizens to a higher proof-of-citizenship requirement for voter registration than U.S.-born citizens,” the lawsuit said.

On Tuesday, the plaintiffs and the defendants, including the secretary of state’s office, both asked U.S. District Judge Carlton Reeves to dismiss the suit. He quickly granted the request.

Republican Gov. Tate Reeves signed House Bill 1510 on April 14, and it became law immediately. He said it “ensures that only American citizens are able to vote in Mississippi.”

“There will be those on the left who will claim that we are making it harder for American citizens to vote,” the governor said in a video posted to social media. “Those claims are false.”

Ezra Rosenberg of the Lawyers’ Committee for Civil Rights Under Law said in the news release Tuesday that naturalized citizens should not be targeted for unequal treatment.

“Their patriotism deserves to be honored, not punished,” Rosenberg said. “The addition of this new safeguard will help prevent naturalized citizens from being erroneously blocked from registering to vote through no fault of their own.”

The final version of House Bill 1510 passed the Mississippi House 114-5 with broad bipartisan support. It passed the Senate 38-13, with most Democrats opposed.

In signing the law, Tate Reeves criticized New York City, which enacted a local law in January to let noncitizens vote in its municipal elections but not state or federal elections. He said “radical activists” pushed to open the ballot box to about 800,000 noncitizens there. New York has the largest population of any U.S. city, about 8.8 million.

More than a dozen communities across the U.S. allow noncitizens to vote in local elections, including 11 towns in Maryland and two in Vermont.

“We’re not going to allow liberals, whether they’re in New York or Washington, D.C., to tell us how to run our local elections,” the governor said.

The new Mississippi law says that if the state and federal databases both raise questions about a person’s citizenship status, the circuit clerk must give notice. The person would have 30 days to prove citizenship with a birth certificate, a U.S. passport or naturalization documents.

The law says if the person fails to prove citizenship within 30 days, their name will be marked “pending” in the Statewide Elections Management System until the next federal general election. That person could cast a provisional ballot during that federal election but would have to prove citizenship within five days for the vote to count. If the person does not vote in that federal election, their name would be marked “rejected” in the Statewide Elections Management System.