North Carolina state Sen. Dan Bishop (R) will face veteran and business executive Dan McCready (D) in September’s do-over election in North Carolina’s scandal-plagued 9th Congressional District, after last year’s results were thrown out amid allegations of election fraud.

Bishop, the lead sponsor of North Carolina’s controversial “bathroom bill,” bested nine other Republican candidates Tuesday in the race to replace 2018 nominee Mark Harris on the ballot, capturing 47 percent of the vote and avoiding a runoff.

McCready ran unopposed on the Democratic side.

McCready trailed Harris by 905 votes in last November’s election, but state election officials tossed out that result earlier this year in the face of voluminous evidence that it was tainted by an alleged ballot-tampering scheme that benefited Harris.

Under North Carolina election law, a primary candidate must capture more than 30 percent of the vote to avoid a runoff.

Bishop’s 2016 “bathroom bill,” which was later repealed, required transgender people to use the bathroom corresponding to the gender on their birth certificate rather than the gender with which they identify. Its enactment triggered a national outcry and a wave of boycotts that analysts say cost the state $3.7 billion.

Union County Commissioner Stony Rushing, who had been endorsed by Harris, trailed Bishop with 19 percent of the vote on Tuesday, followed by former Mecklenburg county commissioner Matthew Ridenhour and real estate agent Leigh Brown, respectively.

The National Republican Congressional Committee congratulated Bishop in a statement and came out swinging at McCready, seeking to tie him to liberal policy proposals such as the Green New Deal and Medicare-for-all.

“We look forward to partnering with Dan and his team to ensure socialist rubber-stamp Dan McCready is forced to finally take positions on his party’s radical ideas,” the NRCC said.

Democrats fired back by reminding voters of the allegations of fraud by Harris’s campaign that tainted the November election.

“Rampant Republican election fraud robbed thousands of North Carolinians of the right to vote that Dan McCready fought to defend in uniform,” Rep. Cheri Bustos (Ill.), chair of the Democratic Congressional Campaign Committee, said in a statement. “Dan McCready’s record of service and his commitment to fighting for lower health care costs and better job opportunities for North Carolina is why he’s clearly the best candidate in this race.”

Tuesday’s election comes after a months-long drama centering on allegations of widespread ­ballot-tampering in the November race.

The man at the center of the State Board of Elections investigation, a political operative hired by Harris named Leslie McCrae Dowless, was indicted in February on seven charges related to the alleged scheme. Prosecutors accused Dowless of paying a crew of workers to illegally collect, fill out, forge and turn in other voters’ ballots in two rural counties within the 9th District.

The board’s decision followed testimony from Harris’s son, John Harris, a federal prosecutor, who said he warned his father in phone calls and emails that he believed Dowless had broken the law in a previous election and should not be hired for the 2018 campaign.

It was a different kind of election fraud than has typically made headlines. Republicans, led by President Trump, have alleged widespread voter fraud, particularly among noncitizens, and have advocated strict ID laws and criminal prosecutions. Democrats have argued that the kind of in-person fraud Republicans have targeted is rare — and accused their opponents of ignoring actual evidence of campaign-driven fraud in the 9th District because it benefited them.

The 9th District stretches along the South Carolina border from Charlotte to eastern North Carolina.