Britain's government says it has modified a controversial data-sharing agreement that allowed officials to track down people who might have broken immigration rules based on information collected by doctors.

The agreement had previously granted the to seek details on people if there were questions about their , an arrangement slammed by British medical organizations as a violation of doctor-patient privilege.

In a statement Wednesday, the government said "the circumstances in which the Home Office will request data ... has changed with immediate effect."

The Home Office said information would only be collected for people being considered for deportation and who were convicted of a serious crime.

Helen Stokes-Lampard, chair of the Royal College of General Practitioners, called the decision "a huge victory for common sense."