Virginia turned blue. Suburbanites voted Democratic. A ruby-red state that went for President Donald Trump by a 30-point margin in 2016 became the political canary in a coal mine for Republicans, with Kentucky making a Democrat its apparent victor in the governor's race.

Tuesday night's contests for state and local offices carried an ominous message for Trump and other Republicans as they hunker down for the 2020 election battle, as Democrats claimed pivotal victories in places the GOP once called home field.

In the state once home to seat of the old Confederacy, Democrats took the majorities in both the Virginia state Senate and the House of Delegates, winning more seats than they needed to control both chambers for the first time in nearly a quarter century.

Cartoons on the Democratic Party View All 303 Images

Every statewide office is now held by a Democrat, and the state's congressional delegation is majority Democratic, the result of demographic changes and an antipathy toward Trump. The results make Virginia – reliably GOP in presidential races as recently as 2004 – an even tougher climb for Trump next year.

"Do you like the color blue?" Gov. Ralph Northam shouted gleefully to a Democratic victory gathering Tuesday night. "I'm here to officially declare today, Nov. 5, 2019, Virginia is officially blue!"

The flip in control of the state legislature means it will be Democrats redrawing the lines for congressional and state legislative races after the 2020 U.S. Census. It also makes it far more likely the state – home to the embattled NRA – will enact background check laws or other gun safety initiatives Democrats made central to their campaigns.

"We absolutely believe this is a warm-up for 2020," says Amanda Renteria, interim president of Emerge, a group that trains Democratic women to run for office.

Virginia is expected to get its first female speaker of the House of Delegates, Eileen Filler-Corn. The Democratic majorities also pave the way for ratification of the Equal Rights Amendment next year and a hike in the minimum wage.

Tom Perez, chairman of the Democratic National Committee, said in a statement that the "historic victory should send a chill down the spines of Donald Trump and every Republican." The DNC had invested heavily in the Virginia election, running what strategists said was the national party's biggest campaign ever for a state legislature race.

Democrats also claimed victory in the Kentucky governor's race, where Andy Beshear appeared to defeat incumbent GOP Gov. Matt Bevin by 5,300 votes – less than half a percentage point. Bevin is refusing to concede, but the Bluegrass State does not have an automatic recount process, so Bevin would have to go to court to get one.

Republicans scored some victories, winning every other statewide race in Kentucky – including electing the state's first African-American attorney general – and taking the Mississippi governor's race easily. A Republican also flipped the Mississippi attorney general's seat and will be the first woman to hold the post.

But overwhelmingly, it was the Democrats' night. They won in unexpected places – such as flipping the mayoral seat in Wichita, Kansas, blue for the first time in decades. They had wins that carried added symbolic impact: A Democrat who lost a Virginia state Senate seat in 2017 after a coin flip broke an electoral tie won the seat easily Tuesday night. A woman who was fired from her job after giving the middle finger to Trump's motorcade in 2017 won a seat on her Virginia county's board of supervisors. The state elected its first Muslim. And Beshear fared unusually well for a Democrat in coal country in Kentucky.

Two worrisome themes emerged for Republicans on Tuesday night: continuing trouble with suburban voters and signs that Trump is not the king maker – or destroyer of Republican candidates he deems insufficiently loyal to him – that he once was.

Trump traveled to Kentucky the night before the election to rally supporters for Bevin, who had nationalized his own race by railing against impeachment and warning of socialist influence.

The president that night made the race a referendum on himself, telling ralliers that "you're sending that big message to the rest of the country. It's so important … because if you lose it sends a really bad message. And they will build it up" as a mark against him, Trump added. "You can't let that happen to me."

After the election results came in, the Trump camp reversed its message. Trump's son, Donald Trump, Jr., told Fox News the gubernatorial election had "nothing to do with Trump."

The campaign released a statement saying, "The President just about dragged Gov. Matt Bevin across the finish line, helping him run stronger than expected in what turned into a very close race at the end. A final outcome remains to be seen."

In fact, Bevin was leading Beshear by 5 percentage points in the last poll taken before the election, and the GOP governor himself was predicting a bigger win.

GOP operatives said the race was not an indicator of the party's strength, since Bevin was so personally unpopular – tracking by Morning Consult ranked Bevin as the second-least-popular governor in the nation – and because the GOP won the other statewide posts. But Democrats countered that Sen. Mitch McConnell, the GOP Senate majority leader from Kentucky who is up for re-election next year, has similarly low approval ratings.

Requests for donations for Amy McGrath, a former Marine fighter pilot who lost a bid for a Kentucky congressional seat in 2018, ramped up on the Internet after Beshear appeared to win.

Republicans also lost in suburban areas, a major warning sign as they seek to reelect Trump, take back the House of Representatives and keep control of the Senate next year. Beshear's lead came in large part because of his strong performance in the suburbs of Cincinnati on the northern Kentucky border. Democrats also defeated the last Northern Virginia Republican to hold a seat in the state legislature

In Pennsylvania – a state critical to Trump's win in 2016 – Democrats scored big victories in the suburban areas of Chester County – where Democrats won a majority on the county council – and Delaware County, near Philadelphia. In Delaware County, Democrats won all five seats on the Delaware County Council for the first time since the Civil War.