The NHS accidentally disclosed data on 150,000 patients who had objected to the sharing of their information, it has emerged.
Data was shared for clinical audits and research on the patients who had opted out of any data information sharing other than for purposes of their care.
In a written statement to Parliament, health minister Jackie Doyle-Price said NHS Digital had recently identified a "supplier defect" in the processing of historical patient objections to the sharing of their confidential health data.
Information on 150,000 "type 2 opt outs" - patients who do not want NHS Digital to share confidential patient information for purposes other than the individual's care - had not been passed to NHS Digital.
As a result, the NHS data body disseminated information on the patients who had previously said they would like to opt out, according to the statement.
The objections had been recorded between March 2015 and June 2018 in some GP practices using a system by healthcare IT company TPP.
Ms Doyle-Price said: "Since being informed of the error by TPP, NHS Digital acted swiftly and it has now been rectified."
She added: "TPP has apologised unreservedly for its role in this matter and has committed to work with NHS Digital so that errors of this nature do not occur again.
"This will ensure that patients' wishes on how their data is used are always respected and acted upon."
All GP practices using the system will be written to about the issue, she said.
Meanwhile, NHS Digital will also write to every affected patient.
The Information Commissioner's Office and the National Data Guardian for Health and Care have been made aware of the issue, Ms Doyle-Price added.
In May this year the Government introduced the new national data opt-out, which replaced the type 2 objections, which it says has simplified the process of registering an objection to data sharing for uses beyond an individual's care.
Copyright (c) Press Association Ltd. 2018, All Rights Reserved. Picture (c) Yui Mok / PA Wire.