Britain has undercounted its long-term immigrants from the European Union by almost a quarter of a million and overestimated how many non-EU students stayed in the country after their studies, statisticians said on Wednesday.
The awkward admission, which throws into doubt Britain's main way of tracking migration, comes as the government prepares to tighten immigration rules after the country is due to leave the European Union on October 31.
Concern about the pace of immigration was a major reason why UK voters backed Brexit in the June 2016 referendum.
The Office for National Statistics said that in the year to March 2016 - the most recent data it had looked at - it believed net EU immigration was 16% higher than it had previously published, while non-EU immigration was 13% lower.
Similar errors had occurred in previous years, it added.
The main body regulating British statistics said the ONS's quarterly immigration data no longer met the highest standards, and backed its decision to reclassify the numbers as 'experimental' until they were improved."
ONS now believes net migration from the EU over the 2009-16 period was about 240,000 higher than originally estimated, while non-EU migration was over-estimated by about 170,000," Jonathan Portes, a professor of economics and public policy at King's College London, said.
More than 3 million foreigners have moved to Britain since the start of 2009, just over a third of them from the EU.
Former prime minister Theresa May sought unsuccessfully to cut net immigration to under 100,000 a year - it was more than double that last year at 258,000 - and she also highlighted an apparent problem of non-EU students overstaying their visas.
Portes, a former chief economist at the government's Department for Work and Pensions and long-term critic of its immigration policy, said the latest data problems showed the flaws of a numerical target for curbing immigration.
Instead, the government should base policy on the needs of the economy rather than arbitrary caps on numbers, he said.
Prime Minister Boris Johnson's new government has given mixed messages on immigration, saying it wants to encourage more scientists to move to Britain but insisting it will immediately restrict EU immigration after Brexit.
Keeping track of new immigrants - and distinguishing them from existing EU immigrants who did not need to fill in forms when they legally settled in Britain - is likely to be tricky.
Unlike most European countries, Britain has no system of identity cards or compulsory registration for EU residents, so counting long-term immigrants has mostly relied on surveying passengers at airports and other entry points.
The ONS said long-term EU immigrants ended up being undercounted, as many did not intend to stay in Britain for the long term when they first arrived.
By contrast, non-EU students leaving Britain often said they were only returning home temporarily, but in fact ended up staying away permanently.