Former President Obama hit the campaign trail in Richmond, Virginia, Thursday night to stump for Virginia gubernatorial candidate Ralph Northam at a campaign event for the Democratic nominee, his second campaign stop of the day for a gubernatorial candidate.

"America is a story of progress," Mr. Obama said. "Ralph Northam wants progress. He wants to take us forward, not backwards."

This election matters, "because our democracy is at stake, and it's at stake right here in Virginia," Mr. Obama continued.

Get Breaking News Delivered to Your Inbox

At a time when politics seems so "divided" and so "nasty," the question is whether voters can support and embrace a candidate like Northam who brings people together, the former president said. Northam faces Republican nominee Ed Gillespie on Election Day, Nov. 7. The former president's speech started out calm, but eventually became louder and more passionate, reminiscent of the speeches Mr. Obama gave about equality and American values when he himself was a candidate and president.

"Folks don't feel good now about what they see," Mr. Obama said. Instead of politics reflecting values, politics are "infecting" communities, he claimed.

"We've got folks who are deliberately trying to make folks angry," and get the base "riled up" for a political advantage, the former president said, without mentioning his successor or Republicans in general.

Mr. Obama mentioned the tragic events in Charlottesville, Virginia, when a woman was killed during a white nationalist rally. The rally was formed in response to the removal of a statute of Confederate General Robert E. Lee from a public park. Mr. Obama said Northam wants to remember history, but in a way that helps heal the nation, not hurt it.

"We don't rise up by repeating the past. We rise up by learning from the past," Mr. Obama said.

The former president urged Democrats to get out and vote, instead of staying home during an off-year election. When Mr. Obama mentioned Gillespie's ads and the crowd booed, the former president said that wasn't the right tactic.

"Don't boo, vote," Mr. Obama said. "Booing doesn't do any good. Voting does some good."

Mr. Obama has largely remained out of the public eye since ending his term in the White House, but earlier Thursday, he campaigned for Phil Murphy, the Democratic candidate for New Jersey governor, in his first public campaign appearance since leaving office.