Imagine if Nigel Farage declared that police should be ready to shoot migrants trying to make it from Calais to Britain; saying: ‘I don’t want to do this, but the use of armed force is there as a last resort.’ And imagine that in spite of this — or perhaps because of it — Ukip were to overtake the Labour party in a national poll to become the most popular opposition party. This, in effect, is what is happening in Germany.

The words above were spoken by Frauke Petry, leader of Alternative für Deutschland (AfD), the insurgent party which is threatening to make large gains in state elections in three key German regions next month. A poll for the newspaper Bild, held after Petry made her remarks at the end of January, put the party ahead of the Social Democrats, the Greens and the Left. It is now poised for a series of triumphs in the state-assembly elections.

[datawrapper chart="http://static.spectator.co.uk/Bh2te/index.html"]

While the possibility of Brexit dominates the news in Britain, a bigger story is brewing in Europe: the EU’s ideal of free movement is collapsing under the weight of political reality. An inability to respond to this crisis is sending millions of voters to extremists, now on the march across the continent. By the time David Cameron’s four-month campaign for Britain to stay in the EU ends, it may be overtaken by events.

The AfD is similar to Ukip, but its rise has been much swifter. It was founded by academics during the euro crisis three years ago. Last year its Eurosceptic founders were ousted and it evolved into more of an anti-immigration party.

In Germany the political climate is incendiary. Here, we fret over the colour of the front doors of the houses in which asylum-seekers are housed. In Germany last weekend, a small crowd gathered in the town of Bautzen to cheer as a building that was being prepared as a hostel for migrants burned to the ground.

Meanwhile, a mob surrounded a coach taking refugees to a hostel in Clausnitz near the Czech border. When the refugees were reluctant to disembark, police dragged some of them out of the bus and to the hostel. No wonder German politicians claim the ‘police can’t cope’. Sickeningly, there were 920 attacks on refugee hostels in Germany last year.

All this might come as a surprise to Britons who remember residents of Munich gathering at the city’s railway station last September to cheer newly arrived migrants, shortly after Angela Merkel had announced that anyone who made it to Germany would be welcome to stay. Germany appears to be swinging from one extreme to the other.

Much of the blame lies with the Chancellor herself. As this magazine argued at the time, her call for Syrian refugees to come to Germany was a tragic mistake — a massive fillip to what was this week revealed to be a £4 billion industry in human trafficking. In trying to set Germany apart as a champion of humanitarian values, she not only overrode legitimate concerns as to how its welfare system would cope with large numbers of migrants, but overlooked what has long been clear to those working at the forefront of the migrant crisis: the people arriving in Europe are not all refugees.

The EU is beginning to admit that about half of its ‘asylum-seekers’ are no such thing. Many, perhaps most, may turn out to be an asset to European economies. But the authorities are unable to cope with the influx and that causes understandable alarm — which, if dismissed as xenophobia, converts into support for populist parties.

The latest data shows that 110,000 people have arrived in Europe by sea so far this year — a tenfold increase on the corresponding period last year. A third are children, many unaccompanied, which presents governments with huge, unprecedented challenges. Children need not just classrooms to study in but homes to stay in. The Swedes have set up homes for these unaccompanied children; last month, a worker at one of the new hostels was killed by one of the teenage wards. Polls suggest the far-right Sweden Democrats are now almost as popular as the governing Social Democrats.

The Belgians this week reinforced their French border with 300 additional officers. While Cameron was trying (and failing) to secure a decent deal with the EU, Austria and Slovenia were coming under attack for having the temerity to limit asylum applications. The EU’s commissars said this is ‘plainly incompatible’ with their law — in which case there is something wrong with EU law.

The EU’s inability to respond to the sheer pace of demographic change means it is becoming a source of instability within Europe. Its member states are asking for the basic tools of nationhood: the ability to control borders, check passports and decide who qualifies for welfare. In refusing, the EU intensifies the crisis. Its intransigence undermines public support for immigration and incubates political crisis —as Angela Merkel is now discovering.

The Prime Minister said this week that Britain must stay in the EU because the country would struggle to negotiate a better trade deal with Brussels in two years’ time. But by then, it is far from clear that there will be an EU at all.

REFERENDUM 2016: THE BATTLE AHEAD

Join Isabel Hardman, James Forsyth and Fraser Nelson at the ICA, near Trafalgar Square, to discuss the campaign with Ben Page, pollster at Ipsos Mori. A subscriber-only event. To book, click here. To subscribe, click here.