CONCORD, N.H. — Republican Gov. Chris Sununu reversed course Friday and signed a bill imposing residency requirements on out-of-state college students who vote in New Hampshire.

Current law allows students and others who consider the state their domicile to vote without being subject to residency requirements, such as getting a New Hampshire driver’s license or registering their cars. Lawmakers passed a bill this year to end the distinction between domicile and residency, but Sununu delayed action on it and asked the state Supreme Court to weigh in. The court issued a 3-2 advisory opinion Thursday saying the bill was constitutional.

“House Bill 1264 restores equality and fairness to our elections,” Sununu said. “Finally, every person who votes in New Hampshire will be treated the same. This is the essence of an equal right to vote.”

The court said the state Constitution doesn’t require giving students special status, and that those who consider their connection to New Hampshire strong enough to vote in the state “may constitutionally be expected to demonstrate such commitment” by getting licenses and registering their cars. Justices also said even if the change imposes a burden, the state has a compelling reason for making it.

In praising the opinion, Republicans said the legislation wasn’t meant to disenfranchise anyone but rather to create a level playing field.

“It is a simple matter of common sense to require those who participate in our elections to abide by the same set of guidelines and become residents of New Hampshire as other voters have done,” said Senate Majority Leader Jeb Bradley, R-Wolfeboro.

Opponents, including Democrats and the American Civil Liberties Union, argued that the bill amounts to a poll tax that will discourage voting. And they blasted Sununu for signing the bill after telling a college student in December that he would never do anything to suppress the vote.

State Rep. Amelia Keane, director of the New Hampshire Young Democrats, said Sununu betrayed the trust of young voters.

“Chris Sununu had the chance to show the young people of New Hampshire that he valued their voices by keeping his promise to veto HB 1264,” she said. “Either he knowingly perpetuated a lie for eight months about a bill he never intended to sign or he succumbed to the political pressure of his party bosses today.”

The state’s all-Democratic congressional delegation also criticized the governor. Sen. Jeanne Shaheen called it “an egregious attack on voting rights” that “severely undermines New Hampshire’s reputation of civic participation.”

The law takes effect July 1, 2019.