Barack Obama visits the Acropolis in Athens.Kevin Lamarque / Reuters

In July 2008, Britain was a solid member of the European Union, where refugee and debt crises had yet to materialize. The global financial crisis was raging, but its consequences weren’t fully appreciated. The Arab world wasn’t yet reeling from pro-democracy uprisings, anti-democracy crackdowns, and civil war. Al-Qaeda in Iraq, the predecessor of ISIS, was shrinking. Donald Trump had recently fired Gene Simmons on The Celebrity Apprentice. And Barack Obama, a youthful, sunny, self-assured presidential candidate, stood before 200,000 people in Berlin and introduced himself not only as an American, but as a “fellow citizen of the world.”

Obama spoke of the Berlin Wall coming down and Europe coming together. “Walls came tumbling down around the world,” he noted. “From Kiev to Cape Town, prison camps were closed, and the doors of democracy were opened. Markets opened too, and the spread of information and technology reduced barriers to opportunity and prosperity. While the 20th century taught us that we share a common destiny, the 21st has revealed a world more intertwined than at any time in human history.”

But he and his fellow global citizens had come to a crossroad, he cautioned: An intertwined world produced intertwined problems—terrorism, climate change, the spread of nuclear weapons—that required intertwined solutions. “The greatest danger of all is to allow new walls to divide us from one another,” Obama declared. “The walls between old allies on either side of the Atlantic cannot stand. The walls between the countries with the most and those with the least cannot stand. The walls between races and tribes; natives and immigrants; Christian and Muslim and Jew cannot stand. These now are the walls we must tear down.”

Eight years later, walls are going up around the world, and borders are being reinforced. Many democracies are threatened by rising strongmen and plunging trust in government. Nationalism and nativism are surging, and trade is slowing. The spread of information and technology is dividing people as much as uniting them. Globalization is falling out of favor; Trumpism is ascendent. Many of these trends were perceptible, if just barely, when Obama stepped up to the podium at the Tiergarten in 2008. Now, however, they are glaringly obvious.

On Wednesday, during his final overseas trip as president of the United States, a less youthful, less sunny, less self-assured Barack Obama addressed a polite, subdued audience in Athens, returning to the themes he’d discussed in Berlin. In the wake of Donald Trump’s victory, in his last big speech abroad, he could have spoken about any number of subjects. He chose to defend democracy in the land where the concept was born 2,500 years ago.

“We’re indebted to Greece for the most precious of gifts—the truth, the understanding that as individuals of free will, we have the right and the capacity to govern ourselves,” he said.

Most remarkably, Obama didn’t take for granted something he had in his Berlin address: that the spread and strengthening of democracy is a good thing. Instead, he went back to basics: In a 50-minute speech, he made the detailed, affirmative case for the political system that the United States has practiced for more than two centuries, and long promoted in the world. “History shows us that countries with democratic governance tend to be more just, and more stable, and more successful,” he argued. Democracy is imperfect and very often infuriating, he allowed. And yet:

It is better than the alternatives because it allows us to peacefully work through our differences and move closer to our ideals. It allows us to test new ideas and it allows us to correct for mistakes. Any action by a president, or any result of an election, or any legislation that has proven flawed can be corrected through the process of democracy.

And throughout [U.S.] history, it’s how we have come to see that all people are created equal—even though, when we were founded, that was not the case. We could work to expand the rights that were established in our founding to African Americans, and to women, to Americans with disabilities, to Native Americans; why all Americans now have the freedom to marry the person they love.  

He praised democracy despite the fact that it had vaulted his nemesis—the man who had questioned his American identity and called him the worst president in the history of the republic—into the White House, to erase many of Obama’s accomplishments:

As you may have noticed, the next American president and I could not be more different. We have very different points of view, but American democracy is bigger than any one person. ...

And that’s why, as hard as it can be sometimes, it’s important for young people, in particular, who are just now becoming involved in the lives of their countries, to understand that progress follows a winding path—sometimes forward, sometimes back—but as long as we retain our faith in democracy, as long as we retain our faith in the people, as long as we don’t waver from those central principles that ensure a lively, open debate, then our future will be OK, because it remains the most effective form of government ever devised by man.

Yet that form of government is now threatened by the very forces he had applauded in Berlin. In his 2008 speech, Obama argued that globalization had brought benefits (open markets, new information technologies) and costs (climate change, transnational terrorism) that needed to be shared globally. In the eight years since, and perhaps most poignantly in the last eight days, he has come to rethink those benefits. Yes, the global economy and technological advances have improved the lives of billions of people around the world, he told his audience in Athens. But for decades they’ve also been disrupting many people’s lives and livelihoods, and increasing inequality within and among nations.

“This inequality now constitutes one of the greatest challenges to our economies and to our democracies,” Obama said. “An inequality that was once tolerated because people didn’t know how unequal things were now won’t be tolerated because everybody has a cellphone and can see how unequal things are.”

The impulse to recoil from the globalized world—to put up walls and barriers—is understandable, he noted, but he pleaded with people to resist the urge, and with policymakers to fix the broken international system before it is torn apart by nationalism and tribalism:

We cannot sever the connections that have enabled so much progress and so much wealth. For when competition for resources is perceived as zero-sum, we put ourselves on a path to conflict both within countries and between countries. So I firmly believe that the best hope for human progress remains open markets combined with democracy and human rights. But I have argued that the current path of globalization demands a course correction. In the years and decades ahead, our countries have to make sure that the benefits of an integrated global economy are more broadly shared by more people, and that the negative impacts are squarely addressed.

The diffusion of information and technology wasn’t an unalloyed good either, he admitted:

It used to be that you might not know how people in another part of your country, or in the cities versus the countryside, were living. Now everybody knows how everybody is living, and everybody can feel threatened sometimes if people don’t do things exactly the way they do things. And they start asking themselves questions about their own identity. And it can create a volatile politics. …

In a world of widening inequality, there’s a growing suspicion—or even disdain—for elites and institutions that seem remote from the daily lives of ordinary people. What an irony it is, at a time when we can reach out to people in the most remote corners of the planet, so many citizens feel disconnected from their own governments.

“History,” Obama said in closing, “does not move in a straight line. Civil rights in America did not move in a straight line. Democracy in Greece did not move in a straight line. … And progress is never a guarantee. Progress has to be earned by every generation. But I believe history gives us hope.” A president who promised hope and change has presided over momentous change, much of it not what he envisioned eight years ago in Berlin. Yet his hope remains.

We want to hear what you think about this article. Submit a letter to the editor or write to letters@theatlantic.com.