RALEIGH, N.C. — Ending an acrimonious stalemate that dragged on for nearly a month, Gov. Pat McCrory, a Republican, conceded in his bid for re-election here on Monday, clearing the way for the ascension of his challenger, the Democrat Roy Cooper, and giving the national Democratic Party a rare cause for celebration.

Mr. Cooper, the state attorney general, declared victory on election night, but Mr. McCrory’s allies lodged election challenges in dozens of North Carolina counties, enraging Democrats who accused Republicans of being sore losers, or worse, in one of 2016’s closest statewide races.

Most of the challenges proved to be of little consequence, however. And by Monday, as partial results of a recount of more than 90,000 votes that Republicans had demanded in Durham County showed no significant change in the results, Mr. McCrory — whose one term was buffeted by nationwide anger over a law he signed that curbed anti-discrimination protections for lesbian, gay, bisexual and transgender people — had little choice but to admit defeat.

“Despite continued questions that should be answered regarding the voting process, I personally believe that the majority of our citizens have spoken and we now should do everything we can to support the 75th governor of North Carolina, Roy Cooper,” Mr. McCrory said in a video statement released on Monday.