Only now does Angela Merkel concede that she made mistakes when admitting a million refugees last year. It was obvious to most people in Europe at the time that her undoubtedly warm-hearted gesture would lead to catastrophic results. In declaring that all Syrian refugees would be welcome if they made it to Germany, she doubled the fortunes of the human trafficking industry. The asylum seekers came from Syria and North Africa through Austria and Hungary, having landed on the shores of Italy and Greece. Thousands died on the way.

When Theresa May addressed the United Nations in New York yesterday, she was able to point to a British way of handling the crisis. Rather than reward those with the strength or money to make it to a western country, Britain has ploughed hundreds of millions of pounds into giving food, shelter and support to far more refugees in Jordan, Turkey and Lebanon. Mrs May didn’t quite say it, but the lessons from the British approach are clear: the 1951 Refugee Convention (the obligation to shelter those who arrive) was designed to prevent a recurrence of problems seen in the 1930s. It needs updating. The world is on the move, but its migration policies are not.

The consequences of getting this wrong are political as well as humanitarian. In Germany, in particular, there is a sense that the authorities have lost control and that established political parties cannot think or talk plainly about the problem. Last weekend, the anti-immigrant Alternative für Deutschland (AfD) won 14 per cent of the popular vote in Berlin state elections, and is now set to become the third-largest party in the Bundestag after next year’s national elections. In Berlin, the Social Democrats, led by the city’s mayor Michael Müller, scraped victory with 22 per cent of the vote. Never in Germany’s postwar history has a winner attracted such a small share.

Merkel’s Christian Democrats finished behind the AfD in elections held in her home state of Mecklenburg-Western Pomerania three weeks ago. As Marine Le Pen remarked at the time, things that haven’t happened for decades are now happening all of the time. Her Front National looks likely to make the final round in the coming French presidential election.

The three-year-old AfD is no German version of Ukip. In January, its leader Frauke Petry called for firearms to be used against migrants trying to enter Germany from Austria. A manifesto it published in May declared that Islam is not compatible with the German constitution, and called for a ban on minarets and burkas. The party’s rise is accompanied by an increase in street violence in Germany. Fighting broke out last weekend between neo-Nazis and asylum seekers in the hilltop town of Bautzen in Saxony; a hundred police were needed to restore order. Two years ago there were 199 criminal attacks on refugee shelters; so far this year there have been 726.

Similar stories can be seen across the continent, where the shock of the summer terror attacks has not subsided. In Austria, a re-run of the presidential election could well lead to a victory for Norbert Hofer of the anti-immigrant Freedom party. The sense of government incompetence has been underlined by the election itself, postponed due to defective glue being used in postal ballot envelopes. Spain is now bracing itself for its third parliamentary election in a year, the various political factions having failed to form a coherent government. The coming Italian referendum on constitutional reform will be more a referendum on Matteo Renzi and his pro-EU government. If he loses, then the beneficiary will be Beppe Grillo’s populist Five Star movement, whose inability to rule is being shown by the chaotic reign of Virginia Raggi, elected mayor of Rome three months ago. No wonder that Jean-Claude Juncker, president of the European Commission, has been talking about an ‘existential crisis’.

And in Britain? Racist and xenophobic politics here have never been weaker. Brexit was a vote to control, rather than reverse, immigration — and a vote to avoid the kind of problems now fermenting on the continent. The explicitly anti-racist Ukip is one of many parties now demanding that Theresa May grants permanent residency rights to all EU migrants living in Britain. The BNP is the only party that disagrees with this, but its vote fell by 99 per cent at the last election. Attempts to create alternative racist parties in recent years have ended in failure.

As Mrs May said in New York, borders serve a purpose. Failure to manage them erodes public confidence, and also undermines support for immigration and for helping refugees. The European no-borders project was conceived at an era where there was very low movement of people - the picture has transformed, now.

Britain has managed a recession and mass immigration with barely a fraction of the xenophobic backlash seen on the Continent. No one would be so bold as to say that racism has been eradicated from Britain - but we have no equivalent of AfD. When you consider the size of the immigration into Britain, and the depth and duration of the recent recession, it's something rather remarkable - and underlines Britain's claim to be not only one of most tolerant countries in the world but the greatest melting pot in Europe.

Mrs May has, so far, failed in her attempts to control immigration. But British refugee policies have been more innovative and effective. We may accept fewer people to our shores, but we do process a significant number. Not so long ago, this magazine was arguing for more Syrians to be admitted - David Cameron responded. The balance is, now, about right. And it's right because Britain now does more than perhaps any other European country to help refugees - precisely because our help is concentrated in countries where help can go furthest.

Mass migration on the scale of recent years is unprecedented. This is a very new problem, but only Britain has responded with a new approach — one that Europe’s leaders might well end up adopting.

This is an extract from this week's magazine, available from tomorrow