North Carolina Republicans have controlled the state’s Ninth Congressional District since 1963. In November, the party celebrated a narrow 905-vote victory over the Democratic candidate, and the long streak appeared unbroken.

But on Tuesday, Republican voters found themselves picking someone else to represent them in a do-over election after last year’s seeming success collapsed in the wake of fraud accusations. By night’s end, The Associated Press had projected that State Senator Dan Bishop, who played a substantial role in North Carolina’s caustic battle a few years ago over bathroom access for transgender people, would be the party’s candidate in the Sept. 10 general election against Dan McCready, the Democrat.

The A.P. projected that Mr. Bishop, who closely aligned himself with President Trump during the primary campaign, would win at least 30 percent of the vote and become the Republican nominee without a runoff.