President Barack Obama gave his farewell speech in Chicago yesterday.

He used the speech to outline threats to American democracy. But he was optimistic about the politically divided country.

“America, we weaken those ties when we allow our political dialogue to become so corrosive that people of good character aren’t even willing to enter public service; so coarse with rancor that Americans with whom we disagree are not just misguided, but malevolent,” Obama said. “We weaken those ties when we define some of us as more American than others; when we write off the whole system as inevitably corrupt, and blame the leaders we elect without examining our own role in electing them.”

He also talked about anti-immigrant sentiment, racism and economic inequality.

“If every economic issue is framed as a struggle between a hard-working white middle class and an undeserving minority, then workers of all shades will be left fighting for scraps while the wealthy withdraw further into their private enclaves,” Obama warned in a jab at his successor, President-elect Donald Trump.

Read more from The Washington Post.