RICHMOND, Va. (AP) -- Virginia Democrats continued their winning streak under President Trump on Tuesday and took full control of the statehouse for the first time in more than two decades.

Suburban voters turned out in big numbers to back Democratic candidates, continuing a trend of once GOP-friendly suburbs turning blue. This is the third election in a row in which Democrats made significant gains since Trump was elected.

"I'm here to officially declare today, November 5, 2019, that Virginia is officially blue," Democratic Gov. Ralph Northam told a crowd of supporters in Richmond.

Of the four states with legislative elections this year, Virginia is the only one where control of the statehouse was up for grabs. Republicans had slim majorities in both the state House and Senate.

National groups, particularly those aligned with Democrats, pumped huge amounts of money into the contests as a way to test-drive expensive messaging and get-out-the-vote campaigns ahead of the 2020 cycle. Gun control and clean-energy groups affiliated with former New York City Mayor Michael Bloomberg spent several million dollars helping Democrats.

Virginia also drew several high-profile visits from 2020 presidential hopefuls, including former Vice President Joe Biden, as well as current Vice President Mike Pence.

President Donald Trump tried to rally Republicans via Twitter but stayed out of Virginia, a state he lost in 2016.

The only candidate Trump endorsed by name, Republican Geary Higgins, was handily defeated in a contest for a northern Virginia Senate district that was previously held by the GOP.

The president's election three years ago has been disastrous for Virginia Republicans, particularly in growing suburban areas. Democrats have won every statewide contest, picked up three additional congressional seats and now are set to control both the state house and the Executive Mansion for the first time since 1994.

Republicans hoped in vain that an off-year election with no statewide candidates on the ballot would help defuse the anti-Trump energy that powered previous cycles. GOP lawmakers also bet on the specter of a possible Trump impeachment providing a last-minute surge by motivating the Republican base.

Story continues

Democrats have pledged that when they take power, they will pass an agenda that Republicans have blocked for years, including stricter gun laws, a higher minimum wage and ratification of the Equal Rights Amendment, making Virginia the final state needed for possible passage of the gender equality measure.

Democrats were keenly focused on gun issues during the election, saying Republicans should be held accountable for failing to pass new restrictions after a mass shooting in Virginia Beach earlier this year.

Republicans accused Democrats of trying to use the tragedy for political gain while focusing heavily on past Democratic efforts to loosen restrictions for third-trimester abortion. The GOP also warned of higher taxes and energy prices if they lose the majority.

House Majority Leader Todd Gilbert on Tuesday predicted that Democrats would pursue an "extreme agenda" that would undo Republican efforts to make Virginia a business-friendly state.

"Virginians should expect public policies that look a lot more like the train-wreck that is California than the Virginia of good fiscal management and common-sense conservative governance," Gilbert said in a statement.

Tuesday's election could help cement Democratic rule for the next decade, because the winners will decide who controls the next redistricting process. Lawmakers approved a proposed constitutional amendment this year that would create a new bipartisan commission empowered to draw legislative and congressional maps, but Democrats would have to sign off on it again next year before it could be presented to voters.