THE fear of immigration is poisoning Western politics. Donald Trump owes his job to it. Brexit would not be happening without it. Strident nationalists wield power in Italy, Hungary, Poland and Austria, and have gained influence elsewhere.

Even Sweden, long a country of refuge, has soured on migrants. The Sweden Democrats, a thunderingly anti-immigrant party, could win the most votes at an election on September 9th (see article). Though it will not form a government, it has already transformed Swedish politics as mainstream parties seek to halt migrants.

The West risks a backlash of the sort that ended the previous great age of mobility, before 1914. That would be a tragedy. Societies that close their doors to migrants will be poorer and less tolerant. Meanwhile, those to whom the doors are closed will see increased suffering, unable to escape the poverty, climate change or violence that prompts them to move.

The stakes could not be higher. Yet advocates of liberal immigration, such as this newspaper, are losing the debate. They need to find better arguments and policies. That demands more honesty about the trade-offs immigration involves.

The walls of nations

International law categorises migrants either as refugees, who are entitled to sanctuary, or as economic migrants, who have no right to go anywhere that does not want them. Yet the distinctions are blurry. Poor countries next to war zones receive huge influxes, while rich countries try to shirk their obligations. And since rich countries admit virtually no economic migrants from poor countries unless they have exceptional skills or family ties, many of them try their luck by posing as refugees. It does not help that states have different rules on who is a refugee. Or that they struggle to send home those who are denied asylum, not least because many of their countries refuse to take them back.

This mess feeds disaffection in the West, and it is a waste. The act of moving from a poor country to a rich one makes workers dramatically more productive (see Briefing). A world with more migration would be substantially richer. The snag is that the biggest benefits of moving accrue to the migrants themselves, while the power to admit them rests with voters in rich countries. Fair enough: democratic accountability is vested largely in national governments. Yet most Western countries, struggling with ageing populations and shrinking workforces, need more migrants. So they have to find ways to make migration policy work for everyone.

The first step is to recognise the causes of the backlash against newcomers. Several stand out: the belief that governments have lost control of their borders; the fear that migrants drain already-strained welfare systems; the perception that migrants are undercutting local workers; and the fear of being swamped by alien cultures.

Assuaging these concerns requires toughness and imagination. Start by regaining control. Overhaul the outdated international systems for aiding refugees; at the same time, open routes for well-regulated economic migration to the West. This will require countries to secure borders and enforce laws: by preventing the hiring of illegal immigrants and deporting those denied asylum, for example. Where they do not exist, the introduction of ID cards can help.

Second, encourage all migrants, including refugees, to work, while limiting the welfare benefits that they can receive. In America, where the safety net is skimpy, labour rules are flexible and entry-level jobs plentiful, even migrants who dropped out of high school are net contributors to the public finances. Sweden, by contrast has a policy that seems designed to stir resentment, showering refugees with benefits while making it hard for them to work. Turkey does a better job at integrating refugees, even if it does not recognise them as such (see article).

A sensible approach would be to allow migrants to get public education and health care immediately, but limit their access to welfare benefits for several years. This may seem discriminatory, but migrants will still be better off than if they had stayed at home. An extreme illustration can be seen in the oil-rich Gulf, where migrants are ruthlessly excluded from the opulent welfare that citizens enjoy. The Gulf is not a model. Migrant workers receive too little protection against coercion and abuse. But because they so obviously pay their way, the native-born are happy to admit them in vast numbers. Elements of that logic are worth considering in the West.

Third, ensure that the gains from migration are more explicitly shared between migrants and the native-born in the host country. One way is to tie public spending, particularly on visible services such as schools or hospitals, more directly to the number of migrants in a region. Another, more radical idea might be to tax migrants themselves, either by charging for entry or, more plausibly, by applying a surtax on their income for a period after arrival. The proceeds could be spent on public infrastructure, or simply divided among citizens. The more immigrants, the bigger the dividend.

The needed and the needy

Cultural objections to immigration are harder to assuage. Newcomers flavour the host culture. And there will inevitably be people who resist that change. History suggests that over time more pluralist countries become more tolerant of immigration. They do so most easily when the flow of migration is smooth (to prevent the sudden surges that make host societies feel swamped) and when newcomers are integrated into the local culture. Ensuring that they work and learn the local language are two powerful levers for achieving that.

How much migration makes sense? The answer will vary from country to country. Belgium is not Canada. Done properly, migration brings economic dynamism. But the shortcomings of today’s policies mean that most Western countries are far more closed than they should be, and they feed the rise of populism. That is both a colossal wasted opportunity and an unnecessary danger.