Even so, compared with the bamboo shacks and fetid detention camps they left behind, Malaysia offers at least some modicum of hope and opportunity, if not the kinder reception, decent jobs and schools, and swift resettlement that many hoped for.

The Rohingya have managed to establish enclaves in several neighborhoods on the edges of Kuala Lumpur, the capital, living in concrete housing blocks and shopping in open-air markets. Here in the Ampang district, tens of thousands of Rohingya crowd into apartments and dilapidated houses that often hold several families each.

Many Rohingya men find occasional work on construction sites or in cheap restaurants in the city, and some women work in stalls and shops. In the Selayang neighborhood, hundreds of Rohingya stall holders sell fruit and vegetables, mixing with other poor migrants, including many from Myanmar.

“We are not rich people, but this is better than what we left behind,” said Mohammed Ayub, a Rohingya who has lived in Malaysia for three years and runs a tailor shop in Taman Muda on the edge of Kuala Lumpur. “What is most important is that we have some security here. We don’t have much, but we have some security.”

Most pressing of all, many migrants said they faced a long, uncertain wait for the United Nations refugee agency office in Kuala Lumpur to accredit them as refugees, which would entitle them to a precious identity card that many see as their best protection against detention or abuse by officials and the police.