President Obama congratulated the two Democrats who won gubernatorial races in Virginia and New Jersey on Tuesday night, saying “this is what happens when the people vote.”

“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.

Democratic Lt. Gov. Ralph Northam defeated Republican Ed Gillespie in the governor’s race in Virginia, and Democrat Phil Murphy beat Republican Lt. Gov. Kim Guadagno in New Jersey’s gubernatorial election.

Democrats also won at least 15 seats in Virginia’s House of Delegates, defeating at least 12 GOP incumbents and flipping three seats that were previously held by Republicans who chose not to seek reelection.

Joyce Craig, a Democrat, was elected mayor of Manchester, N.H., making her the city’s first female mayor.