Democratic gubernatorial candidate Andy Beshear declared victory Tuesday night in his closely watched contest with Kentucky's Trump-backed Republican Gov. Matt Bevin, whose vicious attacks on teachers, anti-union policies, and aggressive efforts to gut Medicaid helped spark what one commentator described as a "working class revolt" that led to his defeat.

"Beshear won by running up the margins in the suburbs and urban areas, but there aren't enough of those in Kentucky to get you over the finish line on their own," HillTV's Krystal Ball, who has lived in Kentucky, wrote in her newsletter Tuesday night. "No, it was coal country that came through and gave Beshear the numbers he needed to pull off the upset."

"I ran on kitchen-table issues, and I will govern focused on those same challenges of good jobs, healthcare for every Kentuckian, protecting and funding our pensions, and always supporting public education."

—Kentucky Gov.-elect Andy Beshear

"The eastern part of the state is culturally conservative," wrote Ball, "but also extremely populist, and they were not having it with Bevin's attacks on workers."

Bevin, who has thus far refused to concede the race, attempted to gin up conservative voters' fears by framing the election as a battle against what he called the "hateful class warfare and communist ideology" of Sen. Bernie Sanders (I-Vt.), a 2020 Democratic presidential candidate.

"Kentucky voters... Which side are you on?" Bevin asked in an August video. "Do you support socialism or do you still believe that America is the greatest nation on earth?"

Kentuckians were apparently unpersuaded by Bevin's hysterical redbaiting, which Beshear overcame with a campaign focused on healthcare, decent-paying jobs, and support for public education. Beshear also benefited from strong get-out-the-vote operations by Working America—the political arm of the AFL-CIO—and the Poor People's Campaign.

Guess Kentucky voters said which side they're on. https://t.co/XSOTFwVf85 — People for Bernie (@People4Bernie) November 6, 2019

"With all the partisan bickering and nastiness that we are seeing in politics, we have an opportunity to do better right here in Kentucky," Beshear said following his apparent victory. "I ran on kitchen-table issues, and I will govern focused on those same challenges of good jobs, healthcare for every Kentuckian, protecting and funding our pensions, and always supporting public education."

As HuffPost's Travis Waldron reported, Beshear's disciplined focus on core economic issues paid off.

"Turnout was higher than expected across Kentucky, and Beshear crushed Bevin in Louisville and Lexington," wrote Waldron. "He carried several counties in the eastern Kentucky coalfields that were traditional Democratic strongholds but have trended away from the party in recent years, suggesting that his attempts to focus the race on health care, education and other economic issues had worked in his favor."

"And Beshear earned a surprising amount of support in some typically deep-red suburban counties where public education has been a key concern and some GOP voters said they supported Beshear instead," Waldron noted.

Beshear's apparent victory was widely viewed as a powerful rebuke to President Donald Trump and Senate Majority Leader Mitch McConnell, both of whom rallied for Bevin just 24 hours earlier in a last-ditch effort to drive turnout for the deeply unpopular Republican governor.

"If you lose, they are going to say Trump suffered the greatest defeat in the history of the world. You can't let that happen to me!" Trump pleaded during a rally in Lexington Monday night.

“If you lose, it sends a really bad message ... you can’t let that happen to me.” Fuck yes. Thanks #Kentucky pic.twitter.com/aWXbkVfrKW — Sara Pearl (@skenigsberg) November 6, 2019

With McConnell and Trump both up for reelection in 2020, Ball argued that national Democrats should "learn from this 'red state' that unexpectedly turned blue on the back of a working class populist backlash."

"Kentucky Democrats did not win by launching esoteric attacks on Bevin about the norms and guardrails of Democracy or lofty ideals like freedom of the press, even though Bevin is probably even more hostile to the press than Trump," Ball wrote. "They did it by staying lightning focused on the way that Bevin had hurt working class families."

The working class revolt comes to KY! National dems are rightly giddy BUT KY Dems did not win by launching esoteric attacks on Bevin about norms and guardrails or lofty ideals like freedom of the press. They did it by focusing on the working class. https://t.co/gKB7NZhxke — Krystal Ball (@krystalball) November 6, 2019

As The Intercept's Ryan Grim wrote Tuesday night, "the Kentucky race has implications for Mitch McConnell, as one of the potential candidates who'd be most formidable against him, sports radio host Matt Jones, said he was watching Bevin's race before deciding whether to get in."

"Amy McGrath, who's already in, has more than $10 million but virtually no chance to win," Grim wrote. "Charles Booker, a progressive Louisville state legislator, is also looking at the race. He told me tonight to 'stay tuned!' when I asked if he was jumping in."

Judd Legum, author of the Popular Information newsletter, said Beshear's apparent win demonstrates that "Democrats can win statewide in Kentucky."

"Mitch McConnell is in danger of losing his seat next year," Legum tweeted.

A chorus Twitter users echoed Legum and sent a clear message to McConnell, who is even more unpopular in Kentucky than Bevin: "You're next."

Democrat Andy Beshear defeats Republican Matt Bevin to take the Kentucky Governorship! Congrats @AndyBeshearKY and all you Kentucky activists! You're next, McConnell. #DemCast https://t.co/1zUfbJVPU9 — Nick Knudsen #DemCast (@DemWrite) November 6, 2019 I'm so proud of you for kicking Bevin to the curb, Kentucky! Please do Mitch McConnell next. — The Humanist Report (@HumanistReport) November 6, 2019 A Democrat won a statewide election in Kentucky today. Mitch McConnell could very well be defeated next year. And he’s the Republican’s most valuable player, several seasons running. — Samuel Sinyangwe (@samswey) November 6, 2019

As the Washington Post reported, Beshear's declaration of victory "left Republicans stumbling and increasingly uncertain about their own political fates next year tied to an embattled and unpopular president."

"Many allies of President Trump rushed to explain away the poor performance of incumbent Kentucky Gov. Matt Bevin as an anomaly," according to the Post, "while other GOP veterans expressed alarm about the party's failure in a state where Trump won by nearly 30 percentage points in 2016—and where he just campaigned this week."