HOSTILITY to immigration was a key driver of Britons’ vote on June 23rd to leave the EU. Theresa May has duly said that freedom of movement from the EU cannot continue as before. Yet curbing migration will be both tricky and costly.

It is numbers that cause the most trouble. In both 2010 and 2015 the Tories said they would cut annual net immigration to the tens of thousands. Yet the figure for 2015, published before the referendum, was 333,000, almost half of it from the EU. Such high EU immigration is relatively new, caused in large part by the accession of ten eastern European countries in 2004 and 2007 (see chart). Figures released on August 25th showed that net immigration in the year to March was still running near record levels.

One issue is what to do about 3.5m existing EU migrants. British Future, a think-tank, finds that 84% of Britons want them to stay, yet the government remains wary of commitment. Mrs May has said she first needs a reciprocal promise for 1.2m Britons living abroad in the EU. There is also some dispute over whether to have a cut-off date, perhaps June 23rd. In reality there is little chance of any deportations, which would surely be illegal. EU migrants have a right to permanent residence after five years in Britain; given how long Brexit may take, that should cover most already there.

Next is the question of what sort of controls to have for new arrivals. Most Brexiteers favour an “Australian” points system similar to that applied to non-EU migrants, which lets in only the skilled and educated. Yet Australia is no longer satisfied with the way its points system works.

According to the Social Market Foundation, another think-tank, only 12% of EU migrants would qualify under the current rules for non-EU migrants. But slashing the number of unskilled could be costly. The food-processing, farming and hospitality industries rely on low-cost labour from eastern Europe. Cutting it off would create labour shortages that would force firms to adapt their business models: more automation, higher wages or just closing down. Employers may also demand a scheme to admit temporary low-skilled workers.

The administrative burden of new restrictions would be heavy. Data on EU migrants range from scanty to non-existent. National-insurance numbers are unreliable, as more are issued than used. The government is unlikely to bring in travel visas, still less identity cards. So enforcement of any system of work permits would rely on employers, landlords and public services, meaning more red tape. The Home Office would have to increase its enforcement role. With its current staffing, it would take 140 years to process all existing EU migrants’ requests for permanent residence, says the Migration Observatory at Oxford University.

Given also the potential backdoor via Ireland, which will keep free movement within the EU but has no border controls with Britain, a big risk is that tighter migration controls will simply mean more illegal migration. Illegal immigrants are less likely than legal ones to pay taxes, receive the minimum wage or secure normal employment or health-and-safety protections.

The supposed economic gains from cutting EU migration are also doubtful. Brexiteers have argued that migrants push down wages, increase pressure on health and education services, take jobs from Britons and make it harder for young people to afford housing. Yet researchers at the Resolution Foundation, another think-tank, dismiss most of these claims.

They argue that there may have been a small downward impact on wages in some industries, but it is dwarfed by the impact of recession. Far from stealing jobs, EU migrants take ones that natives spurn; Britain’s employment rate is at a record high. Since they tend to be young, employed and taxpaying, migrants are net contributors to the state. For that reason they should ease, not raise, pressure on public services and housing—though there is a case for a “migrant impact fund” to channel their taxes towards more local public spending.

Post-Brexit curbs on migration will do economic damage. Other EU leaders have made clear that they also imply more limited British access to the EU’s single market, delivering a further hit to the economy. British Future’s report calls the current system broken and proposes a “national conversation” on immigration policy. Ensuring that politicians (and voters) understand that tougher controls will impose significant costs on the economy would be a good start.