Ending an acrimonious stalemate that dragged on for nearly a month, Gov. Pat McCrory of North Carolina, a Republican, conceded in his bid for re-election today, 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.
Mr. Cooper issued a written statement moments after. “It will be the honor of my life to serve this great state,” he said. “While this was a divisive election season, I know still that there is more that unites us than divides us. Together, we can make North Carolina the shining beacon in the south by investing in our schools, supporting working families and building a state that works for everyone.”
The sealing of Mr. Cooper’s victory — he leads by just over 10,000 votes in the unofficial state tally — brings a modicum of relief to Democrats here. Many of them had feared a post-Election Day power play by North Carolina’s Republicans, who control the state’s General Assembly, where the Republicans in recent years have enacted aggressive gerrymandering plans and a law curtailing voter access that have been struck down by the federal courts. Some feared that the Republicans would take advantage of a law that allows contested elections to be settled by a vote of the legislature.
Mr. Cooper, 59, who has served as North Carolina’s attorney general since 2001, positioned himself as the kind of moderate Democrat who set the tone in state government here for many years before 2010, when Republicans won control of both houses of the legislature for the first time since the late 19th century. Republicans further consolidated power in 2012 with the election of Mr. McCrory.
The backlash, in a state with one of the South’s most vigorous liberal contingents, was perhaps inevitable. In 2013, progressives began a sustained series of protests in Raleigh, the state capital, called “Moral Mondays” that galvanized opposition and drew news media attention with numerous acts of civil disobedience.
Mr. McCrory, who often seemed caught in the middle of these two forces, suffered his biggest blow beginning in March, when he signed the law commonly known as House Bill 2, or H.B. 2. The law nullified local government ordinances establishing anti-discrimination protections for lesbian, gay, bisexual and transgender people, and it required people in publicly owned buildings to use restrooms that corresponded with the gender listed on their birth certificates, which liberals saw as an attack on transgender rights.
National lesbian, gay, bisexual and transgender groups helped marshal nationwide opposition. Soon, major performers were canceling concerts. The N.C.A.A. and the Atlantic Coast Conference moved sports championships out of the state. The N.B.A. moved its All-Star Game to New Orleans.
This undercut Mr. McCrory’s central argument for re-election: that he had been a good steward of the state economy and had engineered a “Carolina comeback” with regulatory and tax relief that helped lower the state’s unemployment rate.
In a statement on Monday, Chad Griffin, president of the Human Rights Campaign, a gay rights organization, said: “Pat McCrory’s reign of discrimination is finally over. McCrory’s stubborn and reckless support of H.B. 2 cost him this election, and his defeat sends a powerful warning to lawmakers across the country that targeting L.G.B.T.Q. people will not be tolerated.”
But Mr. Cooper will come into office seriously constrained by the Republican legislature. In addition to other humiliations for Democrats — President-elect Donald J. Trump won North Carolina, and Republican Senator Richard M. Burr cruised to re-election — the Democrats, despite their pre-election confidence, failed to pick up enough seats in the State House of Representatives to undo a veto override power of the Republicans.
Whether Mr. Cooper will be able to act as anything more than a figurehead remains to be seen. What appears more likely is a continuation — if not an amplification — of the acrimony between the two parties in the wake of the Republicans’ challenges of the election.