He went high.

In the final public address of his presidency, President Barack Obama on Tuesday defended his legacy, even as he appealed to a divided nation to keep striving to reach common ground.

"Yes, our progress has been uneven. The work of democracy has always been hard, contentious and sometimes bloody," Obama said. "For every two steps forward, it often feels we take one step back. But the long sweep of America has been defined by forward motion, a constant widening of our founding creed to embrace all, and not just some."

In an unusual speech at the cavernous Chicago convention center where he celebrated his 2012 re-election win, and just a few miles from his 2008 victory celebration, Obama was, by turns, reflective and combative as he challenged his audience to heed to the nation's founding principles at a time of profound social and economic change.

"For 240 years, our nation's call to citizenship has given work and purpose to each new generation," he said. "It's what led patriots to choose republic over tyranny, pioneers to trek west, slaves to brave that makeshift railroad to freedom."

Obama will leave office more popular than any recent, past American president, with unemployment low and with the stock market booming.

Yet, over the course of his 52-minute address, the nation's 44th chief executive clearly signaled his intent to protect gains he made on climate change, healthcare reform, national security, social issues and in trying to level the economic playing field.

"If I had told you eight years ago that America would reverse a great recession, reboot our auto industry, and unleash the longest stretch of job creation in our history -- if I had told you that we would open up a new chapter with the Cuban people, shut down Iran's nuclear weapons program without firing a shot, take out the mastermind of 9-11 -- if I had told you that we would win marriage equality and secure the right to health insurance for another 20 million of our fellow citizens -- if I had told you all that, you might have said our sights were set a little too high," he said.

Then, he added, "but that's what we did. That's what you did. You were the change."

Obama made his remarks as he prepares to hand the reins of power to a man who is, in every way, a direct repudiation of the last eight years of his administration.

In Donald Trump, Americans get a braggadocio president who is the exact opposite of "No Drama Obama," a man given to unprecedented dissembling; a chief executive who takes to social media to settle scores, a man who has made the national conversation about himself, and not where he intends to take the nation.

Even so, Obama appeared to celebrate Trump's impending inauguration in just 10 days' time, reminding his audience that "the world will witness a hallmark of our democracy: the peaceful transfer of power from one freely-elected president to the next," he said.

"I committed to President-elect Trump that my administration would ensure the smoothest possible transition, just as President Bush did for me. Because it's up to all of us to make sure our government can help us meet the many challenges we still face."

Indeed, Trump threatened to overshadow Obama's speech, as news broke in the hour before the president took the stage that intelligence chiefs had presented Trump with unsubstantiated claims that Russia had damaging information about him.

"Fake news!" Trump tweeted in block capital letters of the story reported by most major news organizations, including CNN and The New York Times. "Total political witch hunt."

At times, Obama's remarks appeared aimed at both his successor and his legions of red baseball cap-wearing supporters, as the president exhorted both his Chicago audience -- and those watching at home -- to move past efforts to divide the nation along class, economic and racial lines.

"Look, politics is a battle of ideas. That's how our democracy was designed. In the course of a healthy debate, we prioritize different goals, and the different means of reaching them," he said. "But without some common baseline of facts, without a willingness to admit new information and concede that your opponent might be making a fair point, and that science and reason matter, then we're going to keep talking past each other."

That talking past each other, he noted, had been made easier by the rise of social media and the 24/7 news cycle.

"For too many of us it's become safer to retreat into our own bubbles, whether in our neighborhoods, or on college campuses, or places of worship, or especially our social media feeds, surrounded by people who look like us and share the same political outlook and never challenge our assumptions," he said. "In the rise of naked partisanship and increasing economic and regional stratification, the splintering of our media into a channel for every taste, all this makes this great sorting seem natural, even inevitable."

He further warned against retreating from globalism and of rebuilding Fortress America, a position embraced by Trump and his supporters.

"The global coalition we're leading against ISIL has taken out their leaders and taken away about half their territory. ISIL will be destroyed. And no one who threatens America will ever be safe," he said.

As he looked back on his own accomplishments, Obama also reflected on the challenges still facing the nation - notably in improving race-relations and fighting terrorism, two battles that he seemed to suggest were of a piece because both involve a ensuring the triumph of American ideals over doctrines of fear.

"But, protecting our way of life, that's not just the job of our military. Democracy can buckle when it gives into 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, interrupted by applause.

"And that's why for the past eight years I've worked to put the fight against terrorism on a firmer legal footing. That's why we've ended torture, worked to close Gitmo, reformed our laws governing surveillance to protect privacy and civil liberties," he continued.

Obama ended his remarks by thanking First Lady Michelle Obama, his daughters Malia and Sasha, Vice President Joe Biden and his wife Jill Biden, as well as staff and supporters.

More than once, Obama paused to compose himself and wipe away tears.

But the president concluded his remarks as he began them, and, finally, in the way he began his presidency, appealing to Americans to pull together and to try harder.

"Yes we can," he said, repeating his 2008 campaign slogan for what was likely the final time. "Yes we did. Yes we can."