Republicans ousted Democratic incumbents in at least six state House races, giving the GOP a slim advantage of 51 seats to Democrats’ 49. That majority could grow to 52 seats after votes are finalized in an outstanding Virginia Beach district. By Saturday morning, the Democratic incumbent trailed by 147 votes, according to the state Board of Elections. Democrats still maintain control of the state Senate.

Democrats in the Legislature ran on a unified message emphasizing their progressive policies, as well as a warning that if Republicans took control, it would jeopardize that progress. In the past two years, unified power in the Legislature allowed Democrats to enact measures on voting rights, police reform, gun control, marijuana legalization and more.

“We spent this election cycle talking about the issues we championed and highlighting the tremendous progress we have made while in the majority,” House of Delegates Speaker Eileen Filler-Corn said in a statement. “Unfortunately, the headwinds were too strong, and the maps drawn by the previous majority presented a challenge that was too great to overcome.”

State House Democrats raked in more than $50.8 million this election cycle, far out-raising Republicans’ total of $23.3 million.

Republicans sought to portray Democrats as out-of-touch radicals and cast the election as a referendum on the left’s agenda. That strategy proved effective. House Democrats lost ground in rural areas and the suburbs, mirroring where McAuliffe also fell short.

The American Conservative Union quickly put out a list of priorities for the Legislature, starting with “overturning all of the dismal policies passed earlier this year.” The Republican group specifically listed a sweeping voting rights package, a bill repealing the ban on abortion coverage on the state’s health care insurance exchange, a measure creating a low-emissions program for vehicles, gun control laws, a bill recognizing racism as a public health crisis and an overtime wage act.

Republicans claimed victory just after midnight on Wednesday, before major networks and The Associated Press declared the results to be final.

“Tonight’s historic upset is proof that Virginians are ready to move closer to an optimistic vision for the commonwealth marked by the protection of individual freedoms and liberties, where parents are empowered, where businesses are allowed to do what’s best for them and their employees, and the safety of communities is a priority number one,” Republican State Leadership Committee President Dee Duncan said in a statement.

“While we are proud of our efforts in Virginia,“ Duncan added, “our remarkable success tonight will inherently motivate national Democrats to attack our razor-thin majorities across the country in 2022, and we know we will have to work harder than ever to protect them.”