Why did Mexico fall so hard for the 64-year-old Andrés Manuel López Obrador, known as Amlo? His landslide victory is down in part to his offer of hopeful renewal and in part down to a national urge to stand up to Donald Trump’s noxious anti-Mexican bullying. But Mr López Obrador won largely because his opponents championed the technocratic, free-market approach that has dominated Mexico since the mid-1980s. That has conspicuously failed to deliver the promised growth to alleviate poverty. Meanwhile violence skyrocketed and corruption soaked the body politic.

A self-styled leftwing outsider, Mr López Obrador is no newcomer to politics. He won his country’s presidency after two failed attempts. Winning may have been the easy part. Governing, as Mr López Obrador knows from his stint as mayor of Mexico City, is harder. Although the presidency is a powerful post, his new party is unlikely to win a two-thirds majority in Mexico’s Congress, which is the threshold for big constitutional reforms. On the campaign trail Mr López Obrador promised to sell the presidential planes, turn the presidential palace into a public park and to halve his salary. But he also ran on a surprisingly sober business agenda overlaid with flashes of economic nationalism.

In his victory speech Mr López Obrador sensibly signalled a shift away from the militarised response to drug cartels that has palpably failed. The question he has yet to answer is how to enforce the rule of law in a country where murders have reached the level of an armed conflict. On the economy, the new president has made it clear that he views Mr Trump’s Nafta negotiations as an opportunity rather than a calamity. Given its natural resources, it is remarkable that Mexico imports so much US food produce.

Mr López Obrador wants to be food independent but has yet to explain how this would be achieved. Mexico is a young democracy; run until 2000 by one party. It is now a tolerant, secular state which has survived economic and democratic crises. There are no serious prospects of regional secession. Mexico’s new president is a friend of Britain’s Labour leader, Jeremy Corbyn, but he reflects his own nation and the struggles it contains. A new Mexican democracy is testing itself. The problems are daunting but a big step is being taken – and the signs are that it is in the right direction.