Democrats have won control of all of Richmond.

In a major victory for the party, Democrats in Virginia on Tuesday flipped both the state Senate and the House of Delegates, giving them control of both the governor’s office and the legislature for the first time in more than two decades, The Associated Press projected.

GOP'S BEVIN REFUSES TO CONCEDE AS KENTUCKY GUBERNATORIAL RACE GOES DOWN TO THE WIRE

"We did it," tweeted former Democratic Gov. Terry McAuliffe. "We got them both. Hard work pays off. VA is ALL BLUE!"

Ahead of Tuesday’s vote, Republicans had a slim majority in both the state House and Senate, but Virginia has been trending blue for years thanks to growth in more diverse, liberal suburbs and cities, and population declines in more rural, conservative areas.

Gov. Ralph Northam, a Democrat, was not up for reelection Tuesday but actively campaigned for Democrats in his state, after surviving the blackface scandal earlier this year.

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

Democrats have promised that, with control of the state legislature, they could pass an agenda that Republicans have blocked for years, including stricter gun laws and a higher minimum wage. They also have aimed to ratify the Equal Rights Amendment, making Virginia the final state needed for possible passage of the gender-equality measure.

VIRGINIA CYCLIST WHO FLIPPED OFF TRUMP'S MOTORCADE APPEARS TO HAVE WON RACE FOR LOCAL OFFICE

Among Democrats who flipped seats: Shelly Simonds, who lost her 2017 bid for a seat in the state's House of Delegates in a random drawing following a tie.

Also in Virginia on Tuesday, Juli Briskman, the female cyclist who flipped off President Trump’s motorcade last year, defeated a Republican incumbent for a seat on the Loudoun County Board of Supervisors.

Briskman launched her campaign for office after she was fired from a government contracting firm for violating the “code of conduct policy." She'd revealed to her bosses at Virginia-based Akima LLC that she was the woman in a viral photo on social media who was flipping off President Trump's motorcade.

Fox News' Vandana Rambaran and The Associated Press contributed to this report.