In an emotional farewell address to the nation, President Barack Obama urged Americans on Tuesday night to stand guard against fear and unite to protect democracy.

Speaking to more than 20,000 people in his hometown of Chicago, Obama warned that hostile foreign influences and domestic strife pose challenges that America must overcome. “Democracy is threatened whenever we take it for granted,” he said.

“Democracy can buckle when we give in to fear. So just as we, as citizens, must remain vigilant against external aggression, we must guard against a weakening of the values that make us who we are,” he said. “How we meet these challenges to our democracy will determine our ability to educate our kids, and create good jobs, and protect our homeland.”

Speaking just 10 days before President-elect Donald Trump is inaugurated, Obama struck a hopeful tone, touting his administration’s accomplishments. While admitting the level of political discourse in America has become corrosive, he noted that “we all share the same proud title: citizen.”

Obama addresses his legacy in Chicago farewell

“Democracy does not require uniformity,” Obama said. “Our founders quarreled and compromised, and expected us to do the same. But they knew that democracy does require a basic sense of solidarity — the idea that for all our outward differences, we are all in this together; that we rise or fall as one.”

Obama urged people to get involved in all parts of the political process, from merely talking to people they may politically disagree with, to organizing to running for office. “Show up. Dive in. Persevere,” he said. “Sometimes you’ll win. Sometimes you’ll lose. ... And, more often than not, your faith in America — and in Americans — will be confirmed.”

Wiping a tear from his eye, Obama thanked his wife, Michelle, for her “grace and grit” and his daughters, Sasha and Malia. “Of all that I’ve done in my life, I’m most proud to be your dad,” he said.

Obama emotional as he pays tribute to first lady

He closed his speech with praise for the next generation.

“You believe in a fair, just, inclusive America; you know that constant change has been America’s hallmark, something not to fear but to embrace, and you are willing to carry this hard work of democracy forward,” Obama said. “You’ll soon outnumber any of us, and I believe as a result that the future is in good hands.”