The legislation, if signed by the governor, means Republicans would get to choose whether to stick with Harris, who appeared to have narrowly won a primary and general election — both now buffeted by allegations of irregularities including tainted absentee ballots — or replace him in the general election.

Harris appeared to have won the November general election against his Democratic opponent, Dan McCready, by 905 votes.

The state Board of Elections and Ethics Enforcement refused to certify the election last month and could order the election to be conducted a second time. The board plans to hold a hearing in the next few days or weeks to explore whether absentee ballots were illegally handled or altered by L. McCrae Dowless Jr., a political operative who worked for Harris.

Harris has denied wrongdoing, and party officials have not publicly backed away from their support of his candidacy.

The legislation approved Wednesday opens the possibility that Robert Pittenger, the incumbent, could again face off against Harris in a rematch of the Republican primary that Harris won with the help of a significant number of absentee votes.

Dowless, who has declined to comment, has a criminal history that includes felony convictions for fraud and perjury. He has been named as a “person of interest” in the state board’s investigation into whether he or people working for him illegally handled or manipulated absentee ballots.

In addition to the questions about irregularities involving absentee ballots, North Carolina Democrats in recent days have said that officials in Bladen County had secretly released the results of early voting to Republicans, providing Republicans with a decisive strategic advantage.

This article originally appeared in The New York Times.