Boosted by millions of dollars from outside groups, Virginia Democrats won control of both state legislative chambers on Tuesday, giving them full control of state government for the first time in 26 years.

All 140 seats in Virginia's General Assembly are up for grabs every two years, and Democrats entered the night hopeful they would enter 2020 with the state's status as a blue state further solidified. Democrats will emerge from Tuesday's election with full control of the legislature, with at least a two-seat majority in the state Senate and an even larger majority in the House of Delegates, which hasn’t been controlled by Democrats since 1999.

The election attracted record levels of outside spending, with more than $13 million pumped into the state by liberal groups and donors.

The state legislature was the last remaining stronghold for Republicans in Virginia, which has gradually shifted leftward over the past three decades.

Democrats won two consecutive gubernatorial elections in Virginia, carried the state in three consecutive presidential elections, and have held both the state's U.S. Senate seats since 2008. While Democrats won a slew of legislative seats in 2017, Republicans managed to maintain narrow two-seat majorities in both legislative chambers.

The last time Democrats controlled both the legislature and governor's mansion was 1993.

The legislative elections attracted the attention of top Democratic presidential nominees, and also former president Barack Obama, who announced endorsements in the state over the weekend. Hollywood celebrities such as Alec Baldwin also campaigned in the state, declaring victory in Virginia the "first step" to defeating President Donald Trump.

Likely more impactful on the outcome of the elections was the amount of money spent in support of Democrats.

Among the largest donors were liberal billionaires George Soros and Michael Bloomberg, who each spent more than a million dollars in support of Democratic candidates running throughout the state. In the race's final weeks, Soros gave Virginia's Planned Parenthood its largest contribution ever. Bloomberg's gun control advocacy group, Everytown for Gun Safety, spent more than $1.5 million in the state.

Virginia governor Ralph Northam, whose fundraising help was accepted by Democratic candidates despite his blackface scandal, will now enjoy allies in the legislature for the final two years of his tenure. It is unclear whether he will attempt to advance policy proposals that have been blocked by Republicans, such as his radical gun confiscation plan.