AFTER the most thrilling and tumultuous election campaign of recent times, the French have defied populism and made history. On May 7th they elected Emmanuel Macron, a 39-year-old former Socialist economy minister who has never fought an election campaign in his life, to be their next president. According to early estimates, the one-time investment banker secured a resounding 65.8% of the vote in the final run-off against his opponent, the nationalist Marine Le Pen. It was an emphatic demonstration that it is possible in a Western liberal democracy to fashion a pro-European, centrist response to populism and nationalism.

This was a historic result on many counts. Mr Macron will become the youngest-ever French president, beating the previous record held by Napoléon Bonaparte’s nephew, Louis-Napoléon, elected in 1848 at the age of 40. In a country that likes presidential candidates to have serial battle scars, Mr Macron has never been a deputy, nor stood for election. He set up his political movement, En Marche! (On the Move!), only 13 months ago. His hopes of building it up against existing party machines, with their deep pockets and decades of experience, looked then like a far-fetched fantasy. Since the Fifth Republic was established by Charles de Gaulle in 1958, no independent candidate without electoral experience has come anywhere close to the French presidency.

Yet Mr Macron tapped into a mood of disillusion, thanks to a combination of fearsome self-belief, a canny reading of the political forces in France, and a good dose of luck. At almost every nationwide election for the past ten years, at all levels of government, the French have voted against the party in power. After five years under a Socialist president, François Hollande, the centre-right Republicans thought that this year’s election belonged to them. But their candidate, François Fillon, was damaged by a parliamentary-payroll scandal. He was only one of many old-timers to be swept aside during this campaign, among them Nicolas Sarkozy (a former president), Alain Juppé and Manuel Valls (two former prime ministers). The young independent candidate had gambled early that a space might open up in the liberal centre; his intuition served him well. Even a massive hacking of his team’s computers on the night of May 5th, which security experts suspected was Russian-orchestrated, was not enough to wreck the vote.

Mr Macron’s extraordinary political adventure began with the observation that existing French parties were not only failing to respond to the fear fuelling populism. The old party division between left and right, he judged, was also hampering a proper effort to fashion a political bulwark against the rise of populist nationalism, as well as blocking consensus around economic reform. From a family of doctors in the provincial northern town of Amiens, the young Mr Macron was a student at the elite Ecole Nationale d’Administration in 2002, when Ms Le Pen’s father, Jean-Marie Le Pen, took the far-right National Front (FN) into the second-round run-off (he lost to the Gaullist Jacques Chirac). He traces his thinking about the failure of party politics to that moment.

The French political class, he wrote in his book, “Révolution”, has been “sleepwalking” ever since. Instead of trying to combat the FN’s ideas, Mr Macron concluded, parties focused on trying to shut them out of power. “As long as traditional parties brandish only fear or morality to fight the FN, it won’t be efficient,” he told The Economist last year. Politicians, he argued, needed to propose something positive, persuasive and engaging instead: an open, tolerant, pro-European society, based on encouraging private enterprise rather than crushing or over-protecting it, and creating paths out of poverty for globalisation’s victims.