THE windows of the Biedronka Polish supermarket in Peterborough are plastered with posters for local events: a Polish “power disco”, a radio festival and a family fun day. On the noticeboard inside hang advertisements for Polish car services, flats for rent and jobs. The city has one of Britain’s fastest-growing populations of European migrants. But next to the poster for “Golden Clinic”, a Polish beauty salon, is a more ominous message. “Being you is not a crime. Targeting you is,” reads a sign from Cambridgeshire Police, encouraging people to report hate crimes.

Before Britain opened its borders and job market to the citizens of eight eastern European countries in 2004, its Office for National Statistics predicted that 5,000-13,000 migrants would come each year. In the end, in the first decade 1.5m arrived, in what by some measures was the single biggest inflow of people in Britain’s history. Poles are now the country’s largest foreign-born community. And a new generation is blooming: last year Polish-born mothers gave birth to 22,382 babies in England and Wales, more than any other foreign group.

But recently net migration from the EU8 countries has fallen close to zero (see chart). In the year to March 2017, some 52,000 EU8 citizens arrived in Britain, 25% fewer than in the previous 12 months. At the same time 46,000 left, 59% more than before. Migrants continue to come from Romania and Bulgaria (known as the EU2), but the pace is slowing. Over the same period 59,000 arrived in Britain, a drop of 14%, while 16,000 left, an increase of 100%.

Economic factors begin to explain the turnaround. Three-quarters of eastern Europeans who have come to Britain since 2004 have come to work, either with the definite offer of a job or seeking employment on arrival. These days British jobs are less attractive than they used to be. Since its recent high in 2015, the pound has depreciated by about 20% against the Polish zloty, reducing the value of migrants’ remittances (and increasing the costs of imported Polish delicacies, sighs the checkout assistant at the Biedronka supermarket). Meanwhile, the gap in living standards between Poland and Britain has steadily narrowed: since 2004 real GDP per person in Poland has increased by around half, while in Britain it has barely budged. Just as important are the feelings of uncertainty and insecurity caused by the Brexit vote, reckons Paulina Trevena, a Polish sociologist at the University of Glasgow. The status of EU citizens in Britain after Brexit is yet to be decided. The Home Office has told them to sign up for e-mail alerts that will inform them if and when their status changes. John Holdich, the leader of Peterborough council, is enthusiastic about the idea of helping European residents but says the uncertainty about their position makes it hard to do so. Extensive coverage in the British and Polish press of the hostility towards migrants in the aftermath of the referendum has also caused alarm. Some fear their rights have already been affected, as British employers and landlords take the Brexit vote as permission to discriminate. On September 9th the equalities minister, Nick Gibb, said his office would review evidence that EU citizens were being illegally prevented from applying for jobs and renting or buying houses. As Britain loses its appeal, migrants are heading elsewhere. Germany has been the most popular destination for Poles for the past three years (Britain has come second). Poland itself is trying to tempt back its diaspora, whose children it is cultivating via Saturday schools (see article). Polish companies and international firms with a presence in Poland are making concerted efforts to attract expat Poles, with companies such as McKinsey reaching out to Polish students’ societies in Britain, for example, says Agata Dmoch, a solicitor in Birmingham.

Paradoxically, a stricter post-Brexit immigration regime, of the sort proposed in a recently leaked Home Office document, could initially result in greater numbers settling in Britain, suggests Michal Garapich, a Polish anthropologist who studies migration. Getting citizenship for a family of four costs more than £5,000 ($6,600). But if Britain were to introduce work permits for skilled Europeans and limit the time that unskilled ones could stay, as suggested in the Home Office proposals, those who commute back and forth might find that stumping up for citizenship was worth it. In the first half of this year 4,171 Poles applied to become British citizens, compared with 1,526 in the first half of 2016.

Stricter immigration rules may also lead to more illegal working. Some industries that many eastern Europeans work in, such as construction, are already quite informal, creating the potential for working off the books. Forecasting how migration flows will change after Brexit is tricky. Predicting whether Britons will be happy with the results is even harder.