RALEIGH, N.C. (AP) — A state senator best known as the sponsor of a headline-grabbing “bathroom bill” that voided anti-discrimination protections for LGBT people won Tuesday’s Republican primary in a special election for a congressional seat vacant since last year’s election was deemed tainted by fraud.

Sen. Dan Bishop topped nine other GOP candidates seeking the 9th Congressional District nomination. The Charlotte attorney raised the most in campaign contributions, seeded with $250,000 from his personal accounts.

In 2016, he sponsored House Bill 2, the law that voided a Charlotte ordinance expanding LGBT rights and prevented similar anti-discrimination rules anywhere else in the state. HB2 was nicknamed the “bathroom bill” because it also directed transgender people to use public bathrooms and showers that matched their birth sex. The measure made waves nationally and prompted boycotts by entertainers, governments and some businesses thinking about moving jobs to North Carolina.

Now, with his primary win, Bishop faces Democrat Dan McCready in the Sept. 10 general election. McCready was unopposed.

The special primary and general elections were required after the state elections board in February determined last year’s contest tainted when Republican Mark Harris used a political operative who collected mail-in ballots. Harris, who narrowly led after November’s votes were counted, opted not to run again.

With conflict between President Donald Trump and Washington Democrats heating up after the investigation into Russian support for the president’s 2016 campaign, the 9th District race is expected to serve as a barometer of political tides.

The election should draw a heavy infusion of political cash over the next four months, foreshadowed by spending in this primary. The political action committee for the anti-tax Club for Growth endorsed Bishop and spent more than $135,000 attacking rivals Stony Rushing and Leigh Brown. The National Association of Realtors’ PAC spent more than $1 million to benefit Brown.

McCready had almost $1.6 million in cash on hand as of May 2, according to Federal Election Commission reports, and after two years of campaigning has built up his name recognition. Despite that, he’ll be swimming upstream in a congressional district that has been in GOP hands since 1963 and which Trump won by 12 percentage points in 2016.

A Bishop television ad during the primary focused on his support for Trump’s border wall proposal and labeled Democrats “crazy liberal clowns.”

Restaurant owner Julie Pressley, 47, of Indian Trail, stopped into her business Tuesday to check on preparations for Rushing’s election-night party, then headed to the polls to vote for the candidate she said she’s known since high school. Rushing and Pressley’s husband serve together on the Union County commission, its executive board. Pressley said that’s allowed her to know that Rushing recognizes he represents people who don’t support him as much as those who do.

“We’ve seen what he stands for as far as the people, what’s best for all the people, not just certain kinds. Whether it be rich people, poor people, whatever, he cares greatly,” said Pressley, who shares Rushing’s low-tax, anti-abortion values. “He’s very concerned about everybody, whether they like him or not. He wants to do what’s best for ’em.”

Mitchell Eudy, 60, of Monroe, said he voted for Dan Bishop in part because he dislikes Rushing. A couple of friends who know Bishop recommended him, said Eudy, who sees the candidate as the most likely to beat McCready.

“I think he will have a broader appeal for the entire population of the 9th District,” Eudy said.

The district stretches from suburban Charlotte to suburban Fayetteville along the South Carolina border.