New Hampshire voters were less than two weeks from casting ballots in a closely contested U.S. Senate race when the Supreme Court of the United States allowed the state to bar student IDs as backup identification during the midterm elections. The justices granted a Republican-backed emergency appeal and blocked the use of student IDs as a backup method of identification, while the underlying state law remained in place.

New Hampshire state Rep. Donald McFarlane said he sponsored the bill to eliminate student IDs for voting because colleges do not have the same controls over issuing those cards as government agencies. “Today’s Supreme Court decision is a victory for common sense,” he said in an email. “It allows HB 323 to work as intended: strengthening voter identity verification, applying a consistent standard, and maintaining public confidence in New Hampshire elections.”

New Hampshire passed a law this year that said student IDs would no longer be an expressly accepted form of identification for obtaining a ballot. The secretary of state then issued guidance barring them as a backup way to prove a voter’s identity.

A judge left the law in place but blocked the guidance in early October, prompting the emergency appeal to the Supreme Court. The court granted that request on Thursday.

The justices cited a longstanding legal principle that judges should not change voting rules too close to Election Day. Justice Ketanji Brown Jackson was the only justice to publicly dissent from the ruling.

The Republican National Committee weighed in to support the state.

For voters, the practical result is that student IDs cannot serve as backup identification in New Hampshire during the midterms. The ruling leaves the state law in place and resolves the conflict over the secretary of state’s guidance.