A PRESIDENT is swept into office after whipping up a wave of grievance and resentment. He claims to represent “the people” against internal exploiters and external threats. He purports to “refound” the nation, and damns those who preceded him. He governs though confrontation and polarisation. His language is aggressive—opponents are branded as enemies or traitors. He uses the media to cement his connection with the masses, while bridling at critical journalism and at rebuffs to executive power. His policies focus on bringing short-term benefits to his political base—hang the long-term cost to the country’s economic stability.

Donald Trump? Yes, but these traits come straight from the manual of Latin American populist nationalism, a tradition that stretches from Argentina’s Juan Perón to Venezuela’s Hugo Chávez and beyond. Yes, Mr Trump is a billionaire capitalist whereas Chávez was an anti-capitalist army officer. But populism is not synonymous with the left: conservatives such as Peru’s Alberto Fujimori used its techniques, too. “Post-truth” politics and “alternative facts” have long been deployed in Latin America, from Mr Fujimori’s use of tabloid newspapers to smear opponents, to Chávez’s imaginary coups and Cristina Fernández de Kirchner’s fake inflation statistics in Argentina.

So when they contemplate Mr Trump’s first few weeks in the White House, many Latin American liberal democrats think they’ve seen this movie before. And they know it usually ends badly. Some of the continent’s own populists, by contrast, recognise Mr Trump as a kindred spirit. Nicolás Maduro, Chávez’s dictatorial successor, criticised a “hate campaign” against Mr Trump—though that was before the United States this week blacklisted Venezuela’s vice-president as a drug kingpin (an allegation Mr Maduro called “baseless”). Guillermo Moreno, the former official entrusted by Ms Fernández with producing Argentina’s statistics, has identified “a Peronist” in Mr Trump, “who is trying to do what we did”.

It is not just Mr Trump’s assault on Mexico’s economy and national dignity, with his threats to tear up the North American Free Trade Agreement and to build a border wall, that Latin Americans have to deal with. The bigger question for the region is what Mr Trump represents in the battle of political ideas. The risk is that he may re-legitimise populist nationalism just when it was waning south of the border. That is especially so in Mexico, where Andrés Manuel López Obrador, who heads opinion polls for the 2018 presidential election, now talks of “the fatherland first”. Even Chile may not be immune: Alejandro Guillier, a former television presenter who boasts of a special bond with “the people”, has a chance in an election in November.

Mr Trump is helping to make life more difficult for those in Latin America who have argued, in the face of the region’s instinctive nationalism and anti-Americanism, that its best interests are served by co-operation with the United States and a liberal world order. “We could all hang our hats on free trade, free markets and macroeconomic stability in part because the United States believed in it, both the Democrats and Republicans,” says Luis Alberto Moreno, the president of the Inter-American Development Bank. “Now there are protectionist forces in the world, and that resonates in the region.”

One response is for Latin America to seek other partners. Though interest in deeper ties with Europe (both the European Union and Brexit Britain) is reviving, China is the main hope. It is already a big trade partner and is investing in infrastructure in the region. But Latin America exports raw materials to China and imports its cheap manufactures. That does less for its economic development than does its more diversified trade with the United States, according to research by the World Bank.

The best response to Mr Trump would be for Latin American liberals to have the courage of their convictions. They should keep their economies open and carry out several tasks they have neglected. These include building more infrastructure and fostering more regional integration, which the populists undermined by turning it into a political slogan rather than a business reality.

Latin American experience teaches that populists are easily underestimated and can stay in power for a long time. But not forever. Populist regimes are often corrupt and spendthrift, and usually fail to make people better off. Whatever the example from the White House, Latin American history shows that populist nationalism is a recipe for national decline. That is the message liberals need to hammer home.