LONDON • "Immigration was the key problem for the United Kingdom and will remain a key problem for you all." These were the parting words of British Prime Minister David Cameron to the leaders of other European Union countries as he attended the final summit of his political career.
Mr Cameron's counterparts avoided engaging with him on this point; instead, they preferred to talk about the British leader's personal responsibility for his country's decision to leave the EU.
Yet deep down, every European politician around that summit table knew that Mr Cameron was right. For the wretched story of Britain's exit from the EU should serve as a grim warning to governments around the world about what happens when the challenge of mass migration is either ducked, or badly handled by them.
It may be fashionable nowadays to dismiss Britons as a bigoted lot, prejudiced against foreigners and obsessed with their own nationalism. Yet that image is not only wrong, but also deeply unfair. For over the past two decades alone, Britain has admitted more than five million foreigners as permanent residents, hardly an inconsiderable number. London is, arguably, Europe's most cosmopolitan urban space, the first European capital to elect a Muslim mayor and probably the only big European city where residents are surprised not when they encounter foreigners, but when they actually get served in a shop or restaurant by a local Brit.
Paradoxically, Britain's current problem with immigrants - which led directly to the country's rejection of the EU - is not the result of bigotry but, as incredible as it may sound today, precisely because the Brits wanted to show the rest of Europe how open they can be. In effect, Britain knocked itself out of the continent after attempting to be more generous than the continent.
As late as the 1990s, the EU was not associated with migration: it was a club of 15 states, with more or less similar standards of living, and migration from the poorer EU members at that time - Greece, Portugal and Spain - was relatively low, thanks in part to the generous EU funding of infrastructure projects in those countries, which kept their people home.
But then came the EU enlargement to the former communist countries of Central and Eastern Europe, which between 2004 and 2007 brought into the bloc at least 12 new nations, most of them far poorer than the Western European average. The British government of then Prime Minister Tony Blair had the option at that time of restricting the movement of people from Eastern Europe for the first seven years after their countries joined the EU; that was written in the treaties which brought the countries into the union.
Yet instead of doing that, Mr Blair breezily announced that Britain would lead the way in Europe and open its frontiers immediately for all newcomers from Eastern Europe. The reason for this generosity was political: Mr Blair sought advantage in trumpeting Britain as a more enlightened country than Germany or France, which kept their immigration controls on East Europeans for the full seven years.
But Mr Blair was also influenced by a study provided by his own civil servants, which estimated that only 13,000 East Europeans would move to the UK each year after Britain's borders were flung open.
In fact, the civil servants had no precedent on which to work, and no relevant data at their disposal; they merely made up the figure of 13,000 based on various extrapolations, none of which would have survived the slightest scientific scrutiny. But neither the prime minister nor any other British minister asked how the figures were arrived at, and no civil servant volunteered that information either.
The result was a catastrophic miscalculation. Hundreds of thousands of East Europeans started arriving each year, from the first year the borders opened; between the time the first assessment was made in 2003 and today, at least 3.5 million people, mostly from Eastern Europe, settled in the UK.
Evidence that not all was well kept pouring into British government offices from all directions: the pressure on housing became acute, schools could not cope with the demand for spaces and daily wages in some sectors like construction fell by a whopping 50 per cent, as labour supply far outstripped local needs.
But successive British governments did nothing. The re-imposition of border controls, which would have been a possible response, was ruled out, since it would have signified an embarrassing admission of defeat. The local authorities were told to manage as best they can. And meanwhile, ministers in London were impressed by another study compiled by their civil servants, showing that, on average, East European migrants were 10 per cent more productive to the British economy than local citizens.
All true, but all largely irrelevant, since this totally ignored the broader social cost imposed by immigration. For the population in Britain's cities, the arrival of migrants from Eastern Europe boosted prosperity: it improved services, increased consumption and sustained rising property prices.
But for the millions of Brits stuck in the decaying old industrial towns of the north of England, for the true "heartlanders", immigration was an economic disaster. In the past, such people had to compete for work in a domestic market of just 64 million; today, they are asked to compete for work in a labour market almost 10 times bigger.
The result was economic decay and exclusion, as Britain's own unemployed also become permanently unemployable, replaced by East Europeans who were better educated, highly motivated and willing to do the job at a fraction of the cost. As British commentator Owen Jones poetically put it, the country's working class which used to be praised as the "salt of the earth" ultimately came to be treated as "the scum of the earth".
Yet bizarrely, the entire political class still refused to do anything. In what is by now one of the country's most iconic modern episodes, then Prime Minister Gordon Brown publicly dismissed as "bigoted" a middle-aged voter who, during the 2010 general election campaign, dared to ask him in polite terms what he proposed to do about East European migration. Yet current PM Cameron also maintained the same air of political correctness, by pretending that the problem is not migration as such, but the people who complain about it. The rebuke to Britain's rulers came during the EU referendum, when the so-called "scum of the earth" suddenly stood up and demanded to be heard.
British politicians have only themselves to blame for the debacle. But leaders of other EU countries would do well to draw the appropriate lessons from Britain's experience. The first lesson is that it's always better for politicians to admit if they are wrong about handling immigration and do something about it, rather than deny ownership of the mistake and continue as though nothing has happened, just in order to save a government's reputation.
Secondly, both politicians and civil servants ought to admit that when it comes to immigration, not everything can be computed or controlled and that, rather like birth rates or other patterns of human behaviour, trends remain unpredictable and unquantifiable, and caution is recommended.
Most importantly, however, European governments ought to remember that immigration is not only about ensuring adequate labour supply or sustaining economic efficiency; it's also about challenging existing national identities and community spirit, about maintaining the implicit contract between those ruling and those ruled. None of these elements can be expressed in statistics. But they are just as significant in deciding the level of immigration.
As Mr Jack Straw - the man who for over a decade was Home and then Foreign Secretary and therefore dealt with the problem from all its angles - recently remarked, Britain's experience with East European immigration was a "case study of how good intentions and apparently good research can lead a government in the wrong direction".
And, ultimately, can also result in a bleak outcome for an entire country.