An apparent Democratic win Tuesday in Kentucky’s gubernatorial race, as well as the Democratic takeover of the Virginia state legislature, left Republicans stumbling and increasingly uncertain about their own political fates.

“It was a rough night,” said Scott Reed, the chief political strategist for the U.S. Chamber of Commerce. “There is a lot of positive news around President Trump’s governing on the economy, on regulations and judges, and it seems to be overwhelmed by the drama.”

Sky-blue campaign signs in Delaware County, Pa., a historically Republican Philadelphia suburb where Democrats swept the ballot box, told the story of how even local council contests had been nationalized.

“Had enough Trump? Flip Delco Nov. 5th,” said the signs, which were stuck on roadsides and outside polling places.

“The state is flipping its political identity,” said Larry Ceisler, a Democratic media consultant in Philadelphia. “The suburbs that used to be moderate Republican suburbs, controlled by the GOP, are almost totally blue, going all the way down to seats on the school boards. Individuals did not matter.”

Many Republican candidates across the country, meanwhile, fell back on the polarizing campaign style that Trump has embraced, denouncing Democratic rivals as “socialist” and warning of illegal immigrant invasions, a strategy that, while spurned in the suburbs, helped them succeed in more rural places such as southwestern Pennsylvania, where Republicans made gains in local elected offices.

Trump’s rural strength helped him flip Pennsylvania, Wisconsin and Michigan, traditionally Democratic states, to gain his electoral college victory. But since then, the losses in suburban areas have had far greater electoral impact, driving the nation’s political shift since the 2016 election. As president, Trump has seen a 47-seat Republican advantage in the U.S. House become a 36-seat deficit, largely because of suburban defections. The number of Republican-held governorships has fallen from 33 to 26, and the percentage of state legislative seats controlled by the party has fallen from 57 to 52.

“Republicans aren’t leaning in on the issues that affect suburban, affluent voters like gun safety and the environment,” said former congressman Ryan Costello (R), who retired from his Chester County, Pa., seat in 2018 rather than face reelection. “Plus, Trump is not a benefit but a burden. That forces Republicans to have to ask voters to really hear them out on issues like taxes and school safety even if those voters don’t like Trump and that’s not easy.”

Trump is showing no sign of shifting his approach, and his campaign, always wary of broadcasting weakness, defiantly made the case of Trump’s strength as Tuesday’s Republican setbacks became apparent.

Over three tweets or retweets in one hour on Tuesday night, Trump claimed that Kentucky Gov. Matt Bevin had been down “at least 15 points,” “17 points” and “maybe 20!” before he visited the state on Monday for a rally.

A mid-October poll by Mason-Dixon found the race tied, 46 percent to 46 percent. Bevin, who has refused to concede defeat and called for a recanvassing of ballots, was trailing by less than a single percentage point Wednesday morning.

Trump’s campaign manager, Brad Parscale, dismissed the journalistic analysis of Bevin’s Democratic rival, Andy Beshear, the son of a former governor who declared victory, as “full of crap.”

“The Democrats nominated a moderate, who’s dad was a moderate, who didn’t talk about impeachment or Trump, and who acts like a Republican,” Parscale wrote. “Talk about Kentucky when an actual Democrat runs.”

But county-level results in the state showed that regardless of Beshear’s strengths and Bevin’s weakness, suburban areas, particularly outside of Cincinnati, underperformed historical trends for Republicans.

The same shift was also evident in Mississippi, where Republican Tate Reeves easily won the governorship. Outside Memphis, Reeves carried 61 percent of the vote, compared with four years ago when the Republican candidate for governor won 80 percent of the vote, according to an analysis by Inside Elections. In Madison County, Miss., which includes tony suburbs of Jackson, the Republican vote margin in the gubernatorial race fell from 69 percent to 49 percent.

The same problems continue to roil Republican politics in other states. Texas House Speaker Dennis Bonnen (R) recently announced he would step aside after he was caught on tape admitting to concerns about Trump’s weakness. “With all due respect to Trump, who I love by the way — he’s killing us in the urban-suburban districts,” Bonnen said in the recording, according to a transcript.

Trump’s campaign hopes those shifts will not prove decisive in 2020, when Trump’s reelection will depend on his success in swing states such as Wisconsin, Michigan, Florida and Pennsylvania, where there are large rural and non-college-educated populations to offset suburban voters.

Republicans also are hoping for help in 2020 from the Democratic nominee for president, given the liberal tilt of high-polling candidates such as Sen. Elizabeth Warren (D-Mass.) and Sen. Bernie Sanders (I-Vt.), who are calling for a Medicare-for-all plan that would replace the current health insurance system.

“We need good candidates who run good campaigns who can speak to college-educated voters,” said Corry Bliss, a Republican strategist, who ran a super PAC for House candidates in 2018. “Thankfully for us, the only other party in American politics is the Democratic Party, and their front-runner just released a proposal that will cost $30 trillion and eliminate private health insurance.”

A Washington Post-ABC News poll released last week found sharp differences in views of Trump between college-educated voters and those who did not get a college degree. About 6 in 10 college graduates strongly disapprove of Trump’s job performance, compared with 42 percent of those without college degrees.

The divide is also sharp when it comes to the underlying facts driving the impeachment investigation now targeting Trump. While 64 percent of college graduates said Trump had done something wrong in his dealings with Ukraine, half of those without degrees said the same thing, according to the poll.

Of next year’s likely swing states, Pennsylvania may provide the most significant challenge to Trump, given the large suburban voting pools within commuting distance of Philadelphia and Pittsburgh.

“GOP should be most concerned about what happened in local elections in Chester, Delaware and Bucks County, PA,” tweeted Josh Holmes, a confidant of Senate Majority Leader Mitch McConnell (R-Ky.). “That is genuinely alarming if you know the voting history.”

Trump’s campaign and White House staff have launched fitful efforts to reach out to suburban voters around issues including prescription drugs, student loans and teenage e-cigarette usage. They also hope to drive turnout among more rural parts of the state.

“Trump’s base is rural and small-town Pennsylvania, white working-class voters whose ancestors worked in the mines and in the mills,” said G. Terry Madonna, a political science professor at Franklin and Marshall College. “Voters in the suburbs and rural, small-town America are on very different paths when it comes to the future of the country.The real fear that the Republicans have is that if the suburbs are the most populous areas and if this trend continues, the problems could worsen.”

Democratic strategists, as they did in 2018, coached candidates to focus on messages about health care and other pocketbook matters, with issues such as Medicaid expansion bolstering Beshear in Kentucky and playing a central role in Democratic victories in Virginia.

Scott Kosar, a Democratic consultant who had multiple winning candidates in Virginia, said he was shocked to see some of them being attacked as illegal immigrant-loving socialists by their Republican rivals in places where that sort of politics did not work in state elections in 2017 and seemed unlikely to succeed this year.

“It sure seems that Republicans have forgotten how to run persuasion campaigns. All they do is polarize the electorate,” Kosar said. “If you look at their success over the last 10 years, they have won by winning in places with historical Democrats who now vote like federal Republicans. That is now over.”

Aaron Blake contributed to this report.