President Obama called for Americans to seek solidarity over division in a celebratory farewell address in Chicago Tuesday, calling for a "new social compact."

Obama's final major speech as president was the same sort of rallying cry to activism that propelled him to the national stage a decade ago, asking supporters to continue the work to "form a more perfect union."

"For all our outward differences, we all share the same proud title: Citizen," he said. "Ultimately, that’s what our democracy demands. It needs you. Not just when there’s an election, not just when your own narrow interest is at stake, but over the full span of a lifetime."

Lamenting racial, economic and social divisions in the country, he exhorted Americans not to retreat into their "bubbles."

"If you’re tired of arguing with strangers on the Internet, try to talk with one in real life," he said.

The address mentioned his successor only once, promising to facilitate "the peaceful transfer of power from one freely-elected president to the next." But it was hard not to see in Obama's parting words a repudiation of a Trump era that has already begun.

"If every economic issue is framed as a struggle between a hardworking white middle class and undeserving minorities, then workers of all shades will be left fighting for scraps while the wealthy withdraw further into their private enclaves," he said.

Obama lauded the contributions of immigrants and Muslim-Americans, and denounced "naked partisanship," income inequality and a splintering media. And he exhorted Americans not to "retreat into our own bubbles" of neighborhoods or churches or even social media feeds.

"Increasingly, we become so secure in our bubbles that we accept only information, whether true or not, that fits our opinions, instead of basing our opinions on the evidence that’s out there," he said. The "selective sorting of the facts" was self-defeating, he said, "because as my mother used to tell me, reality has a way of catching up with you."

He singled out climate change as an example. "We can and should argue about the best approach to the problem. But to simply deny the problem not only betrays future generations; it betrays the essential spirit of innovation and practical problem-solving that guided our founders," he said.

Obama's farewell covered the gamut of administration accomplishments, from the auto bailout to the Affordable Care Act to the killing of Osama bin Laden.

But like George Washington, whose farewell address Obama quoted from, Obama warned against internal divisions.

"After my election, there was talk of a post-racial America. Such a vision, however well-intended, was never realistic," he said. "For race remains a potent and often divisive force in our society. I’ve lived long enough to know that race relations are better than they were ten, or twenty, or thirty years ago – you can see it not just in statistics, but in the attitudes of young Americans across the political spectrum."

Obama consciously chose Chicago as the venue for the speech, departing from a modern tradition that has mostly used the Oval Office as the set for a televised address.

"I first came to Chicago when I was in my early twenties, still trying to figure out who I was; still searching for a purpose to my life," he said. "It was in neighborhoods not far from here where I began working with church groups in the shadows of closed steel mills. It was on these streets where I witnessed the power of faith, and the quiet dignity of working people in the face of struggle and loss. This is where I learned that change only happens when ordinary people get involved, get engaged, and come together to demand it.

"After eight years as your president, I still believe that. And it’s not just my belief. It’s the beating heart of our American idea – our bold experiment in self-government."

Early on, the speech was interrupted by cheers and shouting. "Four more years!"

"I can't do that," Obama said. "In ten days, the world will witness a hallmark of our democracy: the peaceful transfer of power from one freely-elected president to the next," he said, to a smattering of boos.

On the way to Chicago, White House press secretary Josh Earnest told reporters on Air Force One that Obama is “not one to be overly sentimental,” but it would be unrealistic for anyone in his position tonight not to feel some nostalgia

But Obama teared up when he addressed first lady Michelle Obama. "You took on a role you didn’t ask for and made it your own with grace and grit and style and good humor," he said. "You made the White House a place that belongs to everybody. And a new generation sets its sights higher because it has you as a role model. You’ve made me proud. You’ve made the country proud."

The speech also hearkened back to the campaign rhetoric of 2008, ending in the chant of "Yes we can!"

Obama did not specifically address his post-presidential plans. "There will be a time and place” for Obama to speak at length about that, Earnest said. But Obama promised to remain engaged in the causes of his presidency.

"I won’t stop; in fact, I will be right there with you, as a citizen, for all my days that remain. For now, whether you’re young or young at heart, I do have one final ask of you as your President – the same thing I asked when you took a chance on me eight years ago.

"I am asking you to believe. Not in my ability to bring about change – but in yours.

"I am asking you to hold fast to that faith written into our founding documents; that idea whispered by slaves and abolitionists; that spirit sung by immigrants and homesteaders and those who marched for justice; that creed reaffirmed by those who planted flags from foreign battlefields to the surface of the moon; a creed at the core of every American whose story is not yet written."