At least two dozen refugees and asylum seekers have died in Malaysia immigration detention centres since 2015, the United Nations refugee agency has told the Guardian.

Living in fetid, overcrowded cells, inmates are so severely deprived of basic necessities such as food, water, and medical care that the Malaysian national human rights commission described conditions as “torture-like”.

Among a dozen recently-released refugees interviewed by the Guardian, everyone saw at least one inmate die, mostly of disease, but in some cases also due to physical abuse.

“They gave us only one small cup of water with our meals, otherwise we had to drink toilet water,” said Mouyura Begum, an 18-year-old Rohingya refugee detained for over a year at Belantik.

“Only when someone was about to die would the guards come. Otherwise, if we complained, or if we asked to go to the hospital, they beat us,” she said.

All but two of the 24 “people of concern” confirmed dead by the UN were Myanmar nationals. The toll, based on data provided by Malaysian authorities, may represent only a fraction of refugee fatalities in 17 immigration detention centres.

“UNHCR is informed of the death of a detained person of concern when we make a request pertaining to that person,” said Richard Towle, UNHCR’s country representative in Malaysia.

Former detained refugees said they spent months, even years, petitioning the guards to notify UNHCR of their whereabouts — the only way to get their refugee status verified and avoid deportation. The average lock up period is 16 months.

“These deaths are absolutely preventable,” said Amy Smith, executive director of Fortify Rights. “The fix is very easy — Malaysia just has to stop treating refugees like hardened criminals.”

Malaysia’s home ministry this month revealed in parliament that 161 people died of “various diseases” in immigration detention between 2014-2016. It did not indicate how many of the dead were refugees but almost half were from Myanmar, the source of 90% of Malaysia’s refugee population.

“This is what is officially being disclosed, so we should take the numbers as the bare minimum,” said Andrew Khoo, co-chair of the Malaysian Bar Council’s Human Rights Committee.

Relatively affluent Malaysia has long served as a hub for some of the world’s most vulnerable people, including a large number of stateless Muslim Rohingya from Myanmar. As of the end of April, 150,662 refugees and asylum seekers were registered with UNHCR, while tens of thousands more were still unrecognised.

Malaysian law allows foreigners suspected of entering the country illegally to be detained for “such period as may be necessary”. Incarceration can extend upward of five years.

“There is a zeal to take undocumented people off the streets, but then there is a disconnect where there is not enough money or resources to put into the system to avoid torture-like conditions,” said Jerald Joseph, a commissioner at Malaysia’s national human rights commission, SUHAKAM.

One refugee said despite being registered as a person of concern with the UN refugee agency in Malaysia, he was arrested during an immigration raid and held at a juvenile detention facility where he was confined to an overcrowded cell, had to drink toilet water and contracted a skin rash that covered his body. Photograph: Laignee Barron

It is not uncommon for detainees to be confined to cramped cells 24 hours a day for their entire stay. In close quarters, disease spreads rapidly.

As one of the only organisations permitted inside the facilities, SUHAKAM said scabies was the most commonly reported illness, while pneumonia, tuberculosis, and leptospirosis — a bacterial disease often spread by rat urine — had led to inmate deaths.

“We had to sleep on the floor with our knees to our chest.” said a 19-year-old Mon refugee from Myanmar who was released from Sungai Petani juvenile detention in April. He, like many refugees, spoken on the condition of anonymity as he feared retribution for speaking to the media.

Another refugee from Myanmar’s Kachin state who was held for eight months in Bukit Jalil said he saw a Sri Lankan inmate beaten to death. “But they told us he died because he was sick,” he said. As a cell leader, the man had to inform guards when someone died; seven during his detention, he said.

Because of the difficulty of verifying deaths in detention, SUHAKAM has requested autopsy reports for each of the 161 reported deaths.

The home ministry did not respond to request for comment but previously cited budgetary restraints as contributing to poor conditions.