The chair of the Democratic National Committee, Tom Perez, looked out at a jubilant crowd on the evening of Nov. 5. “Two years ago,” he said, “you here in Virginia taught America that we Democrats could win again. Tonight, you’re going to finish the business.”

Perez’s prediction proved accurate. Democrats seized control of both houses of Virginia’s state legislature for the first time in 25 years, aided by unusually high turnout across the state. It was an intensification of the trend that began in 2017, when Virginia’s off-year election provided some of the first signs of the backlash against President Donald Trump that would help Democrats seize control of the House of Representatives in 2018. In a college-campus brew pub here, a diverse crowd of Democrats cheered, hugged and cried as the results rolled in, exceeding their most optimistic expectations.

Tuesday’s results in elections across the country are likely to reverberate nationally. Democrats hope that, like last time, they are a sign of things to come in 2020. The party’s candidate, Andy Beshear, also appeared to have won the governorship of Kentucky, declaring victory over an unpopular GOP incumbent by a slim margin in a state Trump won by 30 points in 2016.

Trump rallied in Kentucky on the eve of the election in an attempt to save the incumbent, Matt Bevin, a prickly former businessman who’d tried to curtail the state’s Medicaid program and feuded with teachers over pensions. “If you lose,” the president said on Nov. 4, “they are going to say Trump suffered the greatest defeat in the history of the world. You can’t let that happen to me!” Bevin, who declined to concede defeat after the vote, had argued that the impeachment of Trump under way in the House would anger GOP partisans and drive them out to vote.

Instead, Bevin’s loss indicates that Trump may be an anchor rather than a buoy for his party. It is likely to factor into the thinking of nervous Senate Republicans as they contemplate whether to continue standing behind Trump despite the increasing evidence he explicitly demanded political favors from the Ukrainian government in exchange for U.S. security aid. This week’s election results suggest that Trump’s appeals do indeed galvanize the GOP base, but he inspires the Democrats even more—a nightmare trap for Republican officeholders who may have to choose between antagonizing the opposition and antagonizing their own side, losing either way.

To be sure, the off-year election was not a wipeout for the GOP. Republicans won every statewide race in Kentucky beside the governor’s, an indication that Bevin’s personal unpopularity was the decisive factor. (Among his many cloddish statements, Bevin once contended that a teachers strike would lead to child molestation; before becoming governor, he had split the Kentucky GOP by running against Senate Majority Leader Mitch McConnell from the right.) The GOP easily held onto the governorship in Mississippi, another deep-red state where Trump held an election-eve rally. The demographic trends Trump accelerated in 2016 continued, with suburban, college-educated and female voters moving toward Democrats while rural areas grew ever stronger for Republicans.

But in Virginia, a historically red state that has voted Democratic in the last three presidential elections, Democrats romped to victory up and down the ballot. The victories came despite a pair of scandals involving Governor Ralph Northam (blackface) and Lieutenant Governor Justin Fairfax (alleged sexual assault), and they carry policy consequences in addition to their symbolic weight. In Manassas’s exurban county, the county board previously chaired by a Trump-loving, anti-immigration neo-Confederate is now majority Democratic for the first time in decades, with a new progressive district attorney and sheriff. Democrats also captured the board in neighboring Loudoun County, where one of the winning candidates was a woman who lost her government-contracting job after being photographed flipping off Trump’s motorcade from her bicycle in 2017. In the statehouse, party leaders plan to use their new majorities to enact gun control and LGBT anti-discrimination laws, raise the minimum wage and pass the Equal Rights Amendment.

The gun issue proved particularly potent and serves as a snapshot of the Old Dominion’s political turnabout. Republicans, buoyed by the Virginia-based National Rifle Association, once wielded the Second Amendment as a political cudgel. But national public opinion on guns has evolved as a cash-rich, activist-driven gun-control movement has risen in recent years. After a mass shooting in Virginia Beach claimed 12 lives in May, the governor convened a special legislative session to consider reforms—only to have GOP leaders adjourn the state House and Senate after 90 minutes without considering any bills. The national gun-control movement poured money into the legislative races, and in polls and news reports, many Virginia voters cited the gun issue as a motivator. Now, in many areas, it is Democrats who see the gun issue as a political asset, a stunning reversal from just a few years ago.

Republicans sought to downplay the election outcome as the result of local factors. In a week’s time, they’ll have a chance to recapture another red-state governorship in Louisiana. But to Perez, the Democratic chairman, this election is a cheering portent. “This is a microcosm of America,” he tells TIME. “In Trump Country, they now see the president for what he is. And they’re coming back to the Democratic side.”

Get our Politics Newsletter. The headlines out of Washington never seem to slow. Subscribe to The D.C. Brief to make sense of what matters most. Please enter a valid email address. Sign Up Now Check the box if you do not wish to receive promotional offers via email from TIME. You can unsubscribe at any time. By signing up you are agreeing to our Terms of Use and Privacy Policy . This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply. Thank you! For your security, we've sent a confirmation email to the address you entered. Click the link to confirm your subscription and begin receiving our newsletters. If you don't get the confirmation within 10 minutes, please check your spam folder.

Write to Molly Ball at molly.ball@time.com.