WHEN Donald Trump vowed to “Make America Great Again!” he was echoing the campaign of Ronald Reagan in 1980. Back then voters sought renewal after the failures of the Carter presidency. This month they elected Mr Trump because he, too, promised them a “historic once-in-a-lifetime” change.

But there is a difference. On the eve of the vote, Reagan described America as a shining “city on a hill”. Listing all that America could contribute to keep the world safe, he dreamed of a country that “is not turned inward, but outward—toward others”. Mr Trump, by contrast, has sworn to put America First. Demanding respect from a freeloading world that takes leaders in Washington for fools, he says he will “no longer surrender this country or its people to the false song of globalism”. Reagan’s America was optimistic: Mr Trump’s is angry.

Welcome to the new nationalism. For the first time since the second world war, the great and rising powers are simultaneously in thrall to various sorts of chauvinism. Like Mr Trump, leaders of countries such as Russia, China and Turkey embrace a pessimistic view that foreign affairs are often a zero-sum game in which global interests compete with national ones. It is a big change that makes for a more dangerous world.

My country right or left

Nationalism is a slippery concept, which is why politicians find it so easy to manipulate. At its best, it unites the country around common values to accomplish things that people could never manage alone. This “civic nationalism” is conciliatory and forward-looking—the nationalism of the Peace Corps, say, or Canada’s inclusive patriotism or German support for the home team as hosts of the 2006 World Cup. Civic nationalism appeals to universal values, such as freedom and equality. It contrasts with “ethnic nationalism”, which is zero-sum, aggressive and nostalgic and which draws on race or history to set the nation apart. In its darkest hour in the first half of the 20th century ethnic nationalism led to war.

Mr Trump’s populism is a blow to civic nationalism (see article). Nobody could doubt the patriotism of his post-war predecessors, yet every one of them endorsed America’s universal values and promoted them abroad. Even if a sense of exceptionalism stopped presidents signing up to outfits like the International Criminal Court (ICC) and the UN Convention on the Law of the Sea (UNCLOS), America has supported the rules-based order. By backing global institutions that staved off a dog-eat-dog world, the United States has made itself and the world safer and more prosperous.

Mr Trump threatens to weaken that commitment even as ethnic nationalism is strengthening elsewhere. In Russia Vladimir Putin has shunned cosmopolitan liberal values for a distinctly Russian mix of Slavic tradition and Orthodox Christianity. In Turkey Recep Tayyip Erdogan has turned away from the European Union and from peace talks with the Kurdish minority, in favour of a strident, Islamic nationalism that is quick to detect insults and threats from abroad. In India Narendra Modi remains outward-looking and modernising, but he has ties to radical ethnic-nationalist Hindu groups that preach chauvinism and intolerance.

Meanwhile, Chinese nationalism has become so angry and vengeful that the party struggles to control it. True, the country depends upon open markets, embraces some global institutions and wants to be close to America (see Banyan). But from the 1990s onwards schoolchildren have received a daily dose of “patriotic” education setting out the mission to erase a century of humiliating occupation. And, to count as properly Chinese you have in practice to belong to the Han people: everyone else is a second-class citizen (see Briefing).

Even as ethnic nationalism has prospered, the world’s greatest experiment in “post-nationalism” has foundered. The architects of what was to become the EU believed that nationalism, which had dragged Europe into two ruinous world wars, would wither and die. The EU would transcend national rivalries with a series of nested identities in which you could be Catholic, Alsatian, French and European all at once.

However, in large parts of the EU this never happened. The British have voted to leave and in former communist countries, such as Poland and Hungary, power has passed to xenophobic ultranationalists. There is even a small but growing threat that France might quit—and so destroy—the EU.

The last time America turned inward was after the first world war and the consequences were calamitous. You do not have to foresee anything so dire to fear Mr Trump’s new nationalism today. At home it tends to produce intolerance and to feed doubts about the virtue and loyalties of minorities. It is no accident that allegations of anti-Semitism have infected the bloodstream of American politics for the first time in decades.

Abroad, as other countries take their cue from a more inward-looking United States, regional and global problems will become harder to solve. The ICC’s annual assembly this week was overshadowed by the departure of three African countries. China’s territorial claims in the South China Sea are incompatible with UNCLOS. If Mr Trump enacts even a fraction of his mercantilist rhetoric, he risks neutering the World Trade Organisation. If he thinks that America’s allies are failing to pay for the security they receive, he has threatened to walk away from them. The result—especially for small countries that today are protected by global rules—will be a harsher and more unstable world.

Isolationists unite

Mr Trump needs to realise that his policies will unfold in the context of other countries’ jealous nationalism. Disengaging will not cut America off from the world so much as leave it vulnerable to the turmoil and strife that the new nationalism engenders. As global politics is poisoned, America will be impoverished and its own anger will grow, which risks trapping Mr Trump in a vicious circle of reprisals and hostility. It is not too late for him to abandon his dark vision. For the sake of his country and the world he urgently needs to reclaim the enlightened patriotism of the presidents who went before him.