EUROPE’S biggest countries were once among the biggest anywhere. In 1950, four of the world’s ten most populous states were in western Europe alone. But decades of falling birth rates have resulted in slower population growth in Europe than in other regions. By 2017, Europe’s most populous country, Germany, ranked just 16th globally. The continent’s birth rate is now so low that the total population in many European countries has begun to decline.

One solution is to attract more foreigners. This week Eurostat, the European Union's statistics agency, said that the region's population rose in 2016 solely because of immigration. The number of births and deaths were equal at 5.1m each, while net migration boosted the population by 1.5m to 511.8m. In 13 of its 28 member countries, more people died than were born last year. But not all saw their populations fall. A large intake of migrants to Germany (mainly Syrian refugees), and smaller net migration to Finland and Poland, meant that populations there still managed to grow.

For all the political difficulties migrants can cause, Europe will need more of them if it wants to avoid shrinking. By 2050, Eurostat estimates that only Ireland, France, Norway and Britain would see their populations rise without migration. In contrast, Germany and Italy need migrants badly: without newcomers, they would face declines of 18% and 16%. And even if migration does continue, Eurostat’s central forecast reckons that Germany will still only just about maintain its current population of 82.8m.

Even sustaining migration at current levels is unlikely to prevent most eastern and Mediterranean countries from shrinking. The former group has been losing people ever since the break-up of the Soviet Union. When those countries joined the EU, large shares of their populations emigrated to richer EU member countries to work, and most of them have stayed there. In Latvia, one of five countries where Eurostat projects emigration will worsen demographic decline, the population fell by a whopping 14% last year. For those who leave, the freedom to live and work where they choose is an immense boon. But the countries where they were raised face a hard task. They must attract and retain new workers, or increase their birth rates, or learn to live with a declining population.