In Kentucky, Attorney General Andy Beshear (D) declared victory over Gov. Matt Bevin (R) by just over 4,600 votes out of more than 1.4 million cast, an apparent upset election in one of the more conservative states in the country.

In Virginia, Democrats reclaimed control of the state's General Assembly for the first time in two decades, building on big gains the party made just a year after Trump took office.

ADVERTISEMENT In both cases, suburban voters delivered for Democrats.

Four years ago, Bevin became just the third Republican-elected governor of Kentucky in half a century, defeating his Democratic rival by about 85,000 votes. He won two counties just across the Ohio River from Cincinnati by a combined 8,000 votes.

On Tuesday, those same two counties favored Beshear by a combined 2,300 votes — a shift of more than 10,000 votes, more than enough to account for Beshear's statewide win. Beshear also won three counties outside of Lexington that Bevin carried four years ago.

In Jefferson County, home of Louisville and the most populous in the state, Beshear beat Bevin by almost 100,000 votes — more than twice as large as the margin by which Bevin's 2015 opponent won it. Beshear almost doubled the 2015 Democratic nominee's performance in Fayette County, home of Lexington.

Across the Appalachians, Virginia voters cast their own suburban curse on the GOP. Republicans in districts in Hampton Roads, along the state's southern border with North Carolina; in the Richmond suburbs; and in wealthy and booming Northern Virginia lost districts they had held for years, if not decades.

The Democratic comeback in the Old Dominion is stunning: When Trump took office, Democrats held just 33 of 100 seats in the state's House of Delegates. Come January, they will hold at least 53 seats — and perhaps as many as 55. In the state Senate, Democrats won at least 21 of 40 seats.

"The voters of Virginia have spoken and they have mandated a Democratic majority in the Senate who will address gun violence prevention, affordable health care and public education funding," said Dick Saslaw, the Democratic Senate leader in Virginia.

The results should serve as a wake-up call for Republicans, who tried to nationalize races across the country in an effort to capitalize on Trump's popularity — and the unpopularity of Democrats' drive to impeach him.

Trump held a rally seeking to boost Bevin and other Republicans in Kentucky on Monday night on the eve of the election, and Vice President Pence appeared in both Kentucky and Virginia in the race's closing days.

But Republican strategists have reason to shrug off some of the results, especially Bevin's lackluster performance in Kentucky. The incumbent governor's approval rating had been dismally low for years, and he barely won his own Republican primary earlier this year.

In other contests in Kentucky, Republicans won races for attorney general, auditor, secretary of state and treasurer, all by comfortable margins. And even Bevin improved his performance over 2015 in small rural counties, a strong sign for Republicans working for a bigger rural turnout in 2020.

In Virginia, the party saved several vulnerable incumbents, including House Speaker Kirk Cox (R), who will keep his seat even if he must surrender the Speaker's gavel.

And in Mississippi, Lt. Gov. Tate Reeves (R) was headed to a victory in the race to replace term-limited Gov. Phil Bryant (R). With 63 percent of precincts reporting, Reeves led Attorney General Jim Hood (D) by a 53 percent to 46 percent margin. Republicans were poised to sweep the Magnolia State's statewide elected offices and build a supermajority in the state legislature as well.

But the losses in Kentucky and Virginia will mark a troubling start to Trump's reelection campaign, especially as other Republicans keep a close eye on his political standing. Trump was not invited to campaign for Republicans in Virginia, and most candidates running in swing seats steered clear of a last-minute rally featuring Pence.

Trump isn't going to lose Kentucky, a state he carried by almost 30 points in 2016. But his efforts to turn voters out for Bevin fell short, even as the president's reelection campaign argued in a statement late Tuesday that he "just about dragged" Bevin "across the finish line."

"You're sending that big message to the rest of the country. It's so important, you got to get your friends, you got to vote. Because if you lose it sends a really bad message," Trump had told Kentucky voters Monday. "You can't let that happen to me."