PARIS — Emmanuel Macron, a youthful former investment banker, handily won France’s presidential election on Sunday, defeating the staunch nationalist Marine Le Pen after voters firmly rejected her far-right message and backed his call for centrist change.

Mr. Macron, 39, who has never held elected office, will be the youngest president in the 59-year history of France’s Fifth Republic after leading an improbable campaign that swept aside France’s establishment political parties.

The election was watched around the world for magnifying many of the broader tensions rippling through Western democracies, including the United States: populist anger at the political mainstream, economic insecurity among middle-class voters and rising resentment toward immigrants.

Mr. Macron’s victory offered significant relief to the European Union, which Ms. Le Pen had threatened to leave. His platform to loosen labor rules, make France more competitive globally and deepen ties with the European Union is also likely to reassure a global financial market that was jittery at the prospect of a Le Pen victory.