Emmanuel Macron gestures from a car en route to Paris after voting during the second round of the French presidential election in Le Touquet, France, on May 7. (Christophe Morin/Bloomberg)

The voters of France acted responsibly and decently on Sunday. But they also sent a warning.

France’s new president-elect is Emmanuel Macron, a 39-year-old centrist whose 2-to-1 victory over the National Front’s Marine Le Pen offered yet another sign that the rise of President Trump is not the harbinger of a new and unhinged form of nationalism. For now, the center is holding, pluralism is hanging on, and the far right is being held in check. As they had in recent elections in Austria and the Netherlands, the friends of liberal democracy prevailed while Trump, who publicly tilted toward Le Pen, suffered another rebuke.

The fact that hackers went after Macron’s campaign and dumped emails publicly just before the vote underscored the election’s international stakes. Russia strongly favored Le Pen and subsidized her party while ultra-right groups across the West saw a Le Pen victory as a chance to break up an alliance system that includes the European Union and NATO. The latest cyberattack increases the urgency of understanding Russia’s role in the 2016 election in the United States.

Macron ran as a confident and unflinching advocate of pluralism and openness, and he will become, instantly, a major global voice for those values. But he will have to govern a deeply torn nation in a surly mood. Le Pen’s share of the vote, while not as high as her supporters had hoped and her detractors had feared, was still a major breakthrough for what had once been a pariah party long dismissed as a neofascist movement rooted in unsavory aspects of French history. Like Trump, Le Pen rallied voters in once prosperous but now ailing industrial towns. Macron swept France’s prospering and cosmopolitan big cities.

The creator of a political party that is only a year old, Macron faces significant challenges reflected in an unusually large number of blank protest ballots. He will have to take on or work around the country’s established parties in June’s legislative elections. He will also have to square the many circles of his neither-left-nor-right campaign platform. He promised both a more flexible regulatory climate for business and solid social protections for a 21st-century economy. Macron is both a former investment banker and a moderate social democrat. Demonstrating how these two sides of him fit together will define the drama of his presidency.

A particular test will be whether he is willing and able to nudge Germany toward a less austere and constraining economic approach to southern Europe. Macron’s election could signal a renewed Franco-German alliance. This would be a tonic for the E.U., but only if it becomes the engine for both reform and more widely shared growth. German Chancellor Angela Merkel quickly expressed her pleasure over Macron’s victory.

None of this will be easy, and if Macron is unsuccessful and the mainstream French right fails to revive itself, many in France fear that Le Pen (who is only 48 years old) could win the next election five years from now.

Macron was endorsed by former president Barack Obama, and their similarities are striking: youth, a hopeful attitude toward the future, a vaguely progressive spirit of moderation and a well-advertised desire to overcome traditional divides.

Less remarked upon is their shared political luck. When Obama ran for the U.S. Senate in Illinois in 2004 — the job that, along with his Democratic National Convention speech that year, propelled him to the national stage — two of his strongest rivals were forced out of the running by sex and marital scandals.

Macron would likely not even have made it to Sunday’s runoff but for the troubles of two key competitors: François Fillon, the candidate of the mainstream right, was caught in a scandal involving paid no-show jobs for his family. The more moderate Socialist alternative, former prime minister Manuel Valls, lost his party’s primary, opening new room in the political center.

But it took more than luck for the new French president to accomplish something most students of French politics thought impossible: From scratch, he built his own political party of the center, En Marche! Its name can be roughly translated as “Onward,” though it might best be seen as a compact Gallic version of John F. Kennedy’s “Let’s get this country moving again.”

Macron grasped that the old left/right divide is an increasingly imperfect construct for the new fissures in a Western politics organized around openness, pluralism and a transnational approach on the one side, and nationalism, more closed economies and a rejection of pluralism on the other.

In the 1990s, President Bill Clinton and British Prime Minister Tony Blair spoke of creating a “Third Way” in politics between an old left and a new right. Under far more trying circumstances, Emmanuel Macron’s victory gives the Third Way a second chance — and liberal democracy a much-needed reprieve.

Read more from E.J. Dionne’s archive, follow him on Twitter or subscribe to his updates on Facebook.