Important lessons have not been learned on preventing deaths and serious self-harming at Maghaberry prison in Northern Ireland, an inspection said.
Despite a reduction in the overall number of men self-harming behind bars, inspectors harboured significant concerns around the management and care of those at risk.
Chief inspector Brendan McGuigan said the continued lack of a safer custody strategy remained an issue and further work was required by the wider criminal justice and healthcare systems to provide alternatives to custody for highly vulnerable prisoners.
However, he said prison leadership had made determined efforts to improve the outcomes for inmates.
Mr McGuigan said: "This positive work and the desire to deliver a more stable, safe environment for prisoners and staff must ensure the needs of vulnerable prisoners are addressed.
"I am concerned that despite the critical reports into deaths in custody and serious self-harm, some important lessons have not been learned, even though a single over-arching death in custody action plan had been developed by the Northern Ireland Prison Service."
Maghaberry in Co Antrim is Northern Ireland's main high-security prison.
The latest in a series of inspection reports found that despite strenuous efforts by management to improve the prison's performance, shortcomings had been found in the care and support of the most vulnerable.
Mr McGuigan, who is the chief inspector of criminal justice in Northern Ireland, said: "Maghaberry prison does not provide a therapeutic environment.
"We were therefore concerned to find the prison was being used as a safe place by the courts while mental health assessments took place
"In our view, this is inappropriate and we have recommended the Departments of Justice and Health should develop an agreed pathway to prevent individuals being admitted to prison for an emergency mental health assessment."
The chief inspector noted the drive, determination, innovation and creativity shown by the leadership team and staff to stabilise the prison, to improve outcomes for those committed to their care and implement nine recommendations made by inspectors two years ago.
The prison has seen a series of inmates taking their own life.
An investigation published earlier this month found flaws surrounding the death of a foreign national in the institution.
The deaths have focused attention on the prison's treatment of those at risk of self-harm or suicide.
Mr McGuigan said the day-to-day regime was more stable and reliable with fewer restrictions around movement and activity occurring.
Progress was also found in education and healthcare.
The chief inspector also voiced his support for the work ongoing to stem the flow of illegal drugs into the prison.
He said: "I am encouraged by the ongoing operations to tackle illicit drugs coming into the prison. However, the misuse of prescription medication and the tendency of some prisoners to experiment with any substance available to get a 'high' remains an issue."
Head of the Northern Ireland Prison Service, Ronnie Armour, said Maghaberry prison will continue to build on progress to ensure all people in custody are given the right support to help them rehabilitate.