That was in 2002. Since then, Democrats have won every statewide election, culminating last fall when Cuomo was handily re-elected to a third term over Marcus J. Molinaro, the Republican Dutchess County executive. The Republicans also lost eight seats in the state Senate, shattering their perennial hold on the majority in Albany’s upper chamber, resulting in an all-Democratic Legislature.

For many party faithful, something had to change. On Monday, that shake-up took place as the party’s longtime chairman, Edward F. Cox, agreed to step aside in the face of a growing rebellion by county chairs, particularly in the more conservative areas in upstate New York.

Many of those county chairs had recently endorsed a leadership challenge by Nick Langworthy, the chair of the Erie County Republican Committee, who will replace Cox at the end of his term in July.

Langworthy, 38, was one of Trump’s earliest supporters, endorsing his candidacy for president in March 2016. He was given a spot on Trump’s transition team that December.

He would be the youngest person to lead the state party, and he faces a daunting challenge: He must support the president’s re-election bid, even though Trump’s unpopularity in New York was a major factor in helping Democrats defeat incumbent Republicans in the midterms.

In the political equivalent of a golden parachute, Cox announced his departure in tandem with “an important new opportunity,” according to the state party: working with Trump’s re-election campaign. He will lead fundraising efforts in New York, according to the Trump campaign.

“Ensuring President Trump is re-elected is the most critical task at hand, and I'm honored to take on the important role of helping deliver the resources he needs for a huge victory next year,” Cox said in a statement.

A dapper dresser with a friendly, formal manner, Cox, the son-in-law of the late President Richard Nixon, was very much the personification of the state’s old-guard of New York Republicans, exemplified by moderate leaders like the former Gov. Nelson Rockefeller and Sen. Jacob Javits. But the national party has banked to the right since Trump’s election, forcing Cox to try to adapt.

Cox, who had been party chair since 2009, had been fending off rumors about his position since last fall’s election debacle, though he had publicly committed to staying in his role, and was up for re-election in July. But as Langworthy continued to assemble, and publicize, a series of endorsements from fellow upstate Republicans, Cox’s hold on the job seemingly faltered.

Cox’s addition to Trump’s 2020 campaign is somewhat curious, considering his history with the president. In 2014, as Trump mulled a challenge to Cuomo for governor, Cox backed Rob Astorino. Trump responded by saying Cox “doesn’t know how to win.

”He’s never won anything,” Trump said in 2014.

But with Trump’s ascension, Cox has been a reliable cheerleader, praising the president’s positions on everything from energy policy to the Mueller Report, which he said “totally vindicated” Trump.

The job on the campaign seemed to have materialized somewhat recently, as Cox had been fiercely trying to retain leadership of the state party. The conversations with the White House intensified over the weekend, said a person with knowledge of negotiations who spoke on the condition of anonymity because of the sensitivity surrounding Cox’s departure.

Republicans in New York stand at something of a permanent disadvantage: Democratic Party registration is more than double that of the Republican Party.

Cox has also been a consistent and sometimes sharp-elbowed critic of Cuomo, whom he’s characterized as a tyrant, liar and threat to the Second Amendment. He even attacked the governor for a recent episode of “The Simpsons,” which depicted upstate New York as a cold, job-starved and physically unfit wasteland.

“‘The Simpsons’ may be a comedy, but the failures under Andrew Cuomo are no laughing matter,” Cox said.

But it was upstate also that seemingly turned against Cox, too, with many county leaders expressing that it was time for a change.

“New York Republicans need a leader that can inspire young people to get involved in our party,” said Dave Wilfong, the county chair in Chautauqua County, in western New York, predicting Langworthy “will get our party back on track.”

This article originally appeared in The New York Times.