The Ministry of Health is investigating after private information of 24,000 dead people was accidentally emailed to 950 pharmacists.
A spreadsheet of data which had dates of birth and death linked to patient's NHI numbers and coded location information was emailed to the pharmacists this morning.
The information relates to 24,092 individuals who died in the six months from January this year.
"Any unintended release of information, even coded, and even to a group of health professionals is not acceptable and the ministry apologises for the error," director information group Graeme Osborne said.
The information was intended to be sent internally and a second email asking recipients to delete it was sent following the error, he said.
The ministry would be investigating why the precautions it had in place to prevent mistakes like this failed, he said.
The email also had a standard warning the attached information was confidential and shouldn't be circulated.
The public rightly expects even coded health information should be secure, Mr Osborne said.
Anyone concerned about the breach should call Healthline, 0800 611 116, for more information.
Labour's Health spokeswoman Annette King says the breach is shocking and inexcusable.
"This data was particularly sensitive. Its release would be hugely distressing to relatives and loved ones."
The breach follows others at government departments including ACC, Work and Income and IRD.