Story highlights "Every office in a democracy counts!" Obama tweeted.

Former Vice President Joe Biden also tweeted congratulations

Washington (CNN) Former President Barack Obama was among the Democrats celebrating their party's electoral wins Tuesday night, congratulating Ralph Northam and Phil Murphy.

"This is what happens when the people vote. Congrats @RalphNortham and @PhilMurphyNJ . And congratulations to all the victors in state legislative, county and mayors' races. Every office in a democracy counts!" Obama tweeted.

This is what happens when the people vote. Congrats @RalphNortham and @PhilMurphyNJ . And congratulations to all the victors in state legislative, county and mayors' races. Every office in a democracy counts! — Barack Obama (@BarackObama) November 8, 2017

Northam won the Virginia governor's race and Murphy took a New Jersey governor's office that had been in Republican Chris Christie's hands for eight years.

Former Vice President Joe Biden also tweeted congratulations, writing, "A resounding defeat tonight for President Trump. Voters around the country rejected the ugly politics we have seen this past year. Instead, they chose candidates who unite and inspire us."

A resounding defeat tonight for President Trump. Voters around the country rejected the ugly politics we have seen this past year. Instead, they chose candidates who unite and inspire us. — Joe Biden (@JoeBiden) November 8, 2017

He continued by individually congratulating Democratic candidates who won across the country so far, including those in mayoral and statehouse contests.

Read More