The new law requires additional identification and throws out the ballots of same-day registrants whose mail comes back as undeliverable, making it harder to register during an early voting period. It was enacted by the state legislature's Republican supermajority after a veto by Democratic Governor Roy Cooper.

The longstanding fight over such measures underscores the impact of even a small number of votes in North Carolina, which despite a Republican legislative majority swings between both major parties in presidential elections. The state is expected to be a battleground in the 2024 White House race.

Democrats said the election law amounted to voter suppression that would particularly hurt certain groups including voters of color.

Republicans, echoing members of their party who have implemented voting restrictions across the country, insisted it will make elections more secure. They accused Democrats of misleading voters and engaging in hyperbolic rhetoric in their opposition.

"These are commonsense reforms that restore faith in our elections," Republican state senators Warren Daniel and Paul Newton said in a joint statement after the override.

Cooper accused Republicans of orchestrating a power grab.

"Republican efforts to change the voting laws have nothing to do with election security and everything to do with manipulating elections to entrench their power," Cooper said in a statement.

"Every single eligible voter deserves fair access to the ballot box and to have their vote count, and North Carolinians will not stand for this voter suppression."

Moments after the vote to override Cooper's veto, the Democratic National Committee and the North Carolina Democratic Party filed a lawsuit challenging the measure, the groups said.

In a statement, they called it a "wide-ranging voter suppression law that will restrict access to early voting across the state, and make it harder to vote - particularly for voters of color, older voters and young voters."

Another lawsuit, filed on behalf of the groups Voto Latino, the Watauga County Voting Rights Task Force and Down Home North Carolina, asks the court to halt the provision of the law that invalidates ballots if a single piece of undeliverable mail is returned by the post office on the day before an election.

(Reporting by Sharon Bernstein; Editing by Colleen Jenkins and Richard Chang)

By Sharon Bernstein