WASHINGTON (AP) — The Supreme Court’s conservative majority on Wednesday left in place Virginia’s purge of voter registrations that the state says is aimed at stopping people who are not U.S. citizens from voting.

One Virginian, whose registration was canceled despite living in the state her entire life, called the purge “a very bad October surprise.”

The high court, over the dissents of the three liberal justices, granted an emergency appeal from Virginia’s Republican administration led by Gov. Glenn Youngkin. The court provided no rationale for its action, which is typical in emergency appeals.

The justices acted on Virginia’s appeal after a federal judge found that the state illegally purged more than 1,600 voter registrations in the past two months. A federal appeals court had previously allowed the judge’s order to remain in effect.

The specter of immigrants voting illegally has been a main part of the political messaging this year from former President Donald Trump and other Republicans, even though such voting is rare in American elections.

Trump had criticized the earlier ruling, calling it “a totally unacceptable travesty” on social media. “Only U.S. Citizens should be allowed to vote,” Trump wrote.

Youngkin said voters who believe they were improperly removed from the rolls can still vote in the election because Virginia has same-day registration.

“And so there is the ultimate, ultimate safeguard in Virginia, no one is being precluded from voting, and therefore, I encourage every single citizen go vote,” Youngkin told reporters.

That option was noted also by the campaign of Vice President Kamala Harris, the Democratic nominee for the White House.

“Every eligible voter has a right to cast their ballot and have their vote counted, and this ruling does not change that,” campaign spokesman Charles Lutvak said in a statement. “Our campaign is going to make sure every eligible voter is able to vote. Voting by noncitizens remains illegal under federal law.”

Rina Shaw, 22, of Chesterfield, Virginia, said she was born in Virginia, has lived in the state her whole life and has never left the U.S.

Shaw thinks she may have forgotten to check a citizenship box on a form when she was updating her voter registration at the Virginia Department of Motor Vehicles while getting her learner’s permit.

“My first reaction was that that was just ridiculous and it shouldn’t have been allowed in October, of all months. It should have been something that happened six months before the election rather than right on the eve of it,” Shaw said.

She planned to cast her ballot during early voting on Wednesday and said she still found the error troubling. Shaw said her voter registration has now been restored.

The Justice Department and a coalition of private groups sued the state earlier in October, arguing that Virginia election officials, acting on an executive order issued in August by Youngkin, were striking names from voter rolls in violation of federal election law.

The National Voter Registration Act requires a 90-day “quiet period” ahead of elections for the maintenance of voter rolls so that legitimate voters are not removed from the rolls by bureaucratic errors or last-minute mistakes that cannot be quickly corrected.

Youngkin issued his order on Aug. 7, the 90th day before the Nov. 5 election. It required daily checks of data from the state Department of Motor Vehicles against voter rolls to identify people who are not U.S. citizens.

Protect Democracy, one of the groups that brought the lawsuit, cited media interviews with other voters as showing that the Youngkin administration’s purge has removed U.S. citizens from the voter rolls.

One example is Nadra Wilson, who lives in Lynchburg, Virginia, and told NPR she got swept up in the purge. “I was born in Brooklyn, New York. I’m a citizen,” Wilson said, before showing her American passport as proof of her citizenship.

Project Democracy said in a statement that “this program removes eligible voters. Virginia has not presented any evidence of noncitizens participating in elections. Because there is none. And it’s actually eligible VA voters that have been caught in the middle of this election-subversion scheme.”

U.S. District Judge Patricia Giles said elections officials still could remove names on an individualized basis, but not through a systematic purge.

Giles had ordered the state to notify affected voters and local registrars by Wednesday that the registrations have been restored.

Virginia’s deadline to register to vote was Oct. 15, but since 2022, the state has allowed same-day registration, which allows people to register to vote in-person and immediately submit a provisional ballot after the deadline to register has passed. The state Department of Elections does not remove names from the voting rolls after the Oct. 15 deadline unless they are names of deceased people.

Nearly 6 million Virginians are registered to vote.

In a similar lawsuit in Alabama, a federal judge this month ordered the state to restore eligibility for more than 3,200 voters who had been deemed ineligible noncitizens. Testimony from state officials in that case showed that roughly 2,000 of the 3,251 voters who were made inactive were actually legally registered citizens.