The agency said the cause of the outbreak was yet to be confirmed but laboratory testing suggested a potential link with a particular dessert.
Three of the five people investigated died, with listeria confirmed as the cause of death for one person. While the other two people to have died had listeria at the time of death it was not listed as the cause of death.
Dr Gauri Godbole, deputy director for gastrointestinal infections, food safety and one health at UKHSA, said: ‘Working with the Food Standards Agency, on a precautionary basis, we have advised NHS trusts and those providing care to vulnerable people to stop serving these desserts while investigations are underway.'
Tina Potter, head of incidents at the FSA said: ‘The FSA, UKHSA, NHS, DHSC, PHW and local authorities are working together to identify the cause of an outbreak of listeria linked to desserts served in NHS trusts and other health care settings.
‘The desserts potentially linked to the reported illness are currently being removed from the supply chain. The food business that supplied the products are undertaking a product withdrawal, as a precaution. The cause of contamination is being investigated, and the local authority is working with the business to ensure appropriate action is taken to protect public health.'
An NHS spokesperson said: ‘The NHS is continuing to support the UKHSA's investigation into an outbreak of listeria thought to be linked to dessert products, and took immediate action once informed to ensure they will not be served in NHS hospitals in the meantime, including issuing urgent guidance to all providers.
‘The NHS is fully committed to the highest food safety standards and works closely with the FSA, UKHSA and Government to ensure the food served for patients, visitors and staff is safe.'