On the surface, President Barack Obama’s farewell address in Chicago on Tuesday night recounted his achievements, values, and still-hopeful vision for America—much like the best speeches. But not far below was a clear template telling his supporters how and where to defend against threats by Donald Trump and the GOP to the America they believe in.

That arc of history is one embraced by larger-than-life figures like Abraham Lincoln and Dr. Martin Luther King Jr. who believed in the imperfect quest to create a more perfect union and the slow but inevitable pace of progress. But it also embraced the historic rise of immigrants who bettered their lives and communities after settling here and the country’s increasingly multi-cultural and open-minded youths, who Obama urged to stay active in politics and work for the change they seek.

“This generation coming up—unselfish, altruistic, creative, patriotic—I’ve seen you in every corner of the country,” Obama said, near the speech’s conclusion. “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. You’ll soon outnumber any of us, and I believe as a result that the future is in good hands.”

Obama’s farewell also recounted his legacy, his greatest social and economic achievements, foreign policy successes without new major wars, and challenged Republicans to find ways to improve Obamacare without ending coverage to 20 million Americans who now have health insurance. But like his greatest speeches from the 2008 presidential campaign or two terms, Obama spent an inordinate amount of time focused on the idea of what it means to be an American.

That idea, which he said was threatened by widening economic inequality, by knee-jerk racism and grievance-based politics, began and was steeped in communitarian values, he said, such as faith, family, dignified work, shared notions of the common good and a belief in participatory democracy.

“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,” Obama said, early in his speech, as he laid a foundation explaining his values and philosophy. “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.”

But Obama reminded Americans and deflated Democrats that the arc of progress is never a straight line, but filled with setbacks.

“For every two steps forward, it often feels we take one step back,” he said, referring to the election results. “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… We remain the wealthiest, most powerful, and most respected nation on Earth. Our youth and drive, our diversity and openness, our boundless capacity for risk and reinvention mean that the future should be ours. But that potential will be realized only if our democracy works. Only if our politics reflects the decency of the our people. Only if all of us, regardless of our party affiliation or particular interest, help restore the sense of common purpose that we so badly need right now.”

With that last phrase—“that we so badly need right now”—Obama began to steer his remarks toward a criticism of Trump and the destructive politics that fueled his election. In a way that Hillary Clinton never quite could, Obama started challenging Trump with her 2016 campaign slogan, “stronger together,” and then laid out the platform to politically retake the country.

“Understand democracy does not require uniformity,” he said, returning to first principles. “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.”

Citing economic inequality as one issue the country must address, Obama said there were not “quick fixes,” but then warned against imaginary enemies from abroad—like Trump’s scapegoats. “I agree that our trade should be fair and not just free. But the next wave of economic dislocation won’t come from overseas. It will come from the relentless pace of automation that makes many good, middle-class jobs obsolete.”

“And so we must forge a new social compact,” he continued, laying out the agenda to fight for and defend. “To guarantee all our kids the education they need; to give workers the power to unionize for better wages; to update the social safety net to reflect the way we live now and make more reforms to the tax code so corporations and individuals who reap the most from the new economy don’t avoid their obligations to the country that’s made their success possible.”

This new social compact must place race at the center of the discussion, Obama said, and not do what many Republicans have done, which is cite Obama’s presidency as evidence that the country has moved beyond race and no longer needed to pay attention to it.

“After my election, there was talk of a post-racial America,” he said. “Such a vision, however well-intended, was never realistic. For race remains a potent and often divisive force in our society… But we’re not where we need to be. All of us have more work to do. After all, if every economic issue is framed as a struggle between a hard-working 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.”

Obama quickly shifted to a fulsome defense of all immigrants. “If we decline to invest in the children of immigrants, just because they don’t look like us, we diminish the prospects of our own children,” he said, “because those brown kids will represent a larger share of America’s workforce. And our economy doesn’t have to be a zero-sum game.”

The idea of America that Obama espoused is not about the privileged and wealthier becoming yet more privileged and wealthier, but about immigrants and ordinary people rising. That class struggle, he said, transcends race and was a factor that unites people even if it forces them to think differently about their predicaments and their neighbors.

“For blacks and other minorities, it means tying our own struggles for justice to the challenges that a lot of people in this country face—the refugee, the immigrant, the rural poor, the transgender American, and also the middle-aged white man who from the outside may seem like he’s got all the advantages, but who’s seen his world upended by economic, cultural, and technological change.” Obama said. “For white Americans, it means acknowledging that the effects of slavery and Jim Crow didn’t suddenly vanish in the ‘60s; that when minority groups voice discontent, they’re not just engaging in reverse racism or practicing political correctness; that when they wage peaceful protest, they’re not demanding special treatment, but the equal treatment our Founders promised.”

“For native-born Americans, it means reminding ourselves that the stereotypes about immigrants today were said, almost word for word, about the Irish, Italians, and Poles,” he continued. “America wasn’t weakened by the presence of these newcomers; they embraced this nation’s creed, and it was strengthened.”

Obama said the fragmentation of the media and reemergence of partisan politics based on hateful principles—two pillars of Trump’s campaign—undermine the ties that should bind people.

“For too many of us, it’s become safer to retreat into our own bubbles, whether in our neighborhoods or college campuses or places of worship or our social media feeds, surrounded by people who look like us and share the same political outlook and never challenge our assumptions,” he said. “The rise of naked partisanship, 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. And 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.”

After saying that climate change was real and the best paths forward should be debated, not avoided—and to deny that reality is to condemn future generations—Obama summed up his prior remarks and issued the warning that most directly addressed the threat posed by Trump and his brand of politics.

“It’s that [American] spirit—a faith in reason, and enterprise, and the primacy of right over might, that allowed us to resist the lure of fascism and tyranny during the Great Depression, and build a post-World War II order with other democracies, an order based not just on military power or national affiliations but on principles—the rule of law, human rights, freedoms of religion, speech, assembly, and an independent press,” Obama said. “That order is now being challenged—first by violent fanatics who claim to speak for Islam; more recently by autocrats in foreign capitals who see free markets, open democracies, and civil society itself as a threat to their power,” he continued. “The peril each poses to our democracy is more far-reaching than a car bomb or a missile. It represents the fear of change; the fear of people who look or speak or pray differently; a contempt for the rule of law that holds leaders accountable; an intolerance of dissent and free thought; a belief that the sword or the gun or the bomb or propaganda machine is the ultimate arbiter of what’s true and what’s right.”

The counter and solution to this threat, Obama said, was an active participatory democracy.

“But protecting our way of life requires more than our military. 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. “That’s why I reject discrimination against Muslim Americans. That’s why we cannot withdraw from global fights—to expand democracy, and human rights, women’s rights, and LGBT rights—no matter how imperfect our efforts, no matter how expedient ignoring such values may seem. For the fight against extremism and intolerance and sectarianism are of a piece with the fight against authoritarianism and nationalist aggression. If the scope of freedom and respect for the rule of law shrinks around the world, the likelihood of war within and between nations increases, and our own freedoms will eventually be threatened.”

Obama closed his speech by appealing to his supporters to participate more, not withdrawal.

“Our democracy is threatened whenever we take it for granted,” he said, wrapping up. “All of us, regardless of party, should throw ourselves into the task of rebuilding our democratic institutions. When voting rates are some of the lowest among advanced democracies, we should make it easier, not harder, to vote. When trust in our institutions is low, we should reduce the corrosive influence of money in our politics, and insist on the principles of transparency and ethics in public service. When Congress is dysfunctional, we should draw our districts to encourage politicians to cater to common sense and not rigid extremes. And all of this depends on our participation; on each of us accepting the responsibility of citizenship, regardless of which way the pendulum of power swings.”

Obama sought to end his farewell address on the same hopeful note that he began his presidency, by urging people not to give up on their visions and dreams, and to help make the political world a better reflection of those values.

“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: Yes We Can. Yes We Did. Yes We Can.”

Steven Rosenfeld covers national political issues for AlterNet, including America’s democracy and voting rights, campaigns and elections, and many social justice issues.

IMAGE: President Barack Obama acknowledges the crowd as he arrives to deliver his farewell address in Chicago, Illinois. REUTERS/John Gress