The Home Office will no longer use NHS records to track down illegal immigrants, it has been announced.
An agreement between the two organisations will be significantly narrowed so that health records will only be shared in cases involving "serious criminality".
The move was revealed by digital minister Margot James in the Commons on Wednesday.
It came in response to an amendment to the Data Protection Bill, proposed by Health Select Committee chair Dr Sarah Wollaston.
Ms James said that ministers had "reflected" on the "concerns" and would change the agreement "with immediate effect".
The bar for sharing data will now be set "significantly higher", she added.
"No longer will the names of overstayers and illegal entrants be sought against health service records to find current address details," Ms James promised.
The data will now only be used in future to trace someone who is being considered for deportation.
Ms Wollaston said she was "delighted" at the news and thanked her colleagues and other campaigners.
Civil liberties group Liberty welcomed the move but accused the Government of "undermining the confidentiality and trust at the heart of our healthcare system in the name of pursuing their hostile environment".
More from NHS
The charity's advocacy director, Corey Stoughton, said: "We welcome the Government's agreement to overhaul its practices and immediately curtail some data sharing – but its language is worryingly vague.
"We need a cast-iron commitment that people will no longer have to fear immigration enforcement when seeking urgent medical care."