'This is America:' Obama uses distant ancestry to Confederate general to denounce Charlottesville and Trump
US President Barack Obama speaks at a Democratic National Committee event at Gilley's Club in Dallas, Texas on March 12, 2016 (AFP Photo/Mandel Ngan)

During a campaign speech in Richmond, Virginia Thursday for gubernatorial candidate Ralph Northam, former President Barack Obama addressed some of the issues that have divided the country over the past few months.

He explained that Americans shouldn't use the most painful parts of American history to hurt others or divide the country.

"We saw what happened in Charlottesville but we also saw what happened after Charlottesville," Obama said. "When the biggest gatherings of all rejected fear and rejected hate. Where the decency of the American people came out. That's how we rise. We don't rise up by repeating the past, we rise up by learning from the past. We try and maintain some kind of mainline level of decency and patriotism. Of coming together. Of believing the good in other people and not the worst."

He noted that his genealogy traces him back to Jefferson Davis, a general for the confederacy, who Obama said is a very distant "something" far removed. "I'll bet he's spinning in his grave," Obama joked.

"The point is that, that is America," he continued. "We claim all of our history, the good and the bad. We can acknowledge that Thomas Jefferson, one of Virginia's most famous sons, owned and sold slaves. That's not disputable. And we can also acknowledge that he wrote the words 'We hold these words to be self evident that all men are created equal. That they are endowed by their creator with certain unalienable Rights, that among these are Life, Liberty and the Pursuit of Happiness.' And we can recognize that even if our past is not perfect, we can honor the Constitutional ideals that have allowed us to come this far and to keep moving toward a more perfect union. That's what America is."

He also spoke of Republican candidate Ed Gillespie as a candidate who has tried to divide America. The comments were remarkably similar to criticisms of President Donald Trump.

"He thinks if you scare enough voters you might win enough votes to win an election," Obama said. "If you have to win a campaign by dividing people you're not going to be able to unite them later if that's where you start."

Watch the full speech below: