Thousands of migrants have arrived in Indonesia and north-west Malaysia over the past week. Finally on land after being abandoned at sea, they are being held in detention centres until the authorities decide what to do with them.

Tensions between Rohingya and Bangladeshi migrants at a shelter in Aceh have led to them being separated into two separate groups to prevent fights from breaking out. A barbed wire partition was put up to keep the two groups apart.

"They keep fighting and quarrelling with each other and they are not compatible with each other. That is why we have separated them. So the Myanmar people are here and the Bangladeshis are there to avoid anything bad from happening," said Sunarya, head of Langsa police.

Both Rohingya and Bangladeshi migrants have blamed each other for fights that broke out onboard their boat. About 100 people are believed to have died in a deadly fight involving axes, knives and metal bars after traffickers abandoned them at sea.

Many of the migrants are Bangladeshis who set sail seeking jobs and a better life. The others are Rohingyas, a stateless people who have escaped persecution in Myanmar.

Work is under way to determine the migrants' identities so they can be processed as refugees or be repatriated back to their home countries.

"For the Myanmar people or ethnic Rohingya, we will wait for the order from our superior to place them in the immigration detention centre. As for the Bangladeshi the embassy has already come and taken data from them and they will cross-check with Bangladesh and will do the repatriation," said immigration official Cut Anna Darmawan.

Officials have used loudspeakers to appeal to local people living near the shelter in Aceh not to get too close to the migrants, fearing they could spread disease. But people have ignored the orders.

Hundreds have thronged the two warehouses where the migrants have been housed since their arrival, bringing rice, instant noodles, clothing and home-cooked meals.

Indonesia has "given more than it should" to help the Rohingya and Bangladeshi migrants, its foreign minister has said. Retno Marsudi said she will meet with Malaysian and Thai officials to discuss how to solve the migrant problem with help from their countries of origin, the UN refugee agency and the International Office for Migration.

Marsudi said Indonesia has sheltered 1,346 Rohingya and Bangladeshi migrants who washed on to Aceh and North Sumatra provinces earlier in May. The first group came on 10 May with 558 people on a boat, while the second with 807 on three boats landed on 15 May.

Even before the crisis, nearly 12,000 migrants were being sheltered in Indonesia awaiting resettlement, she said, with most of those Rohingya Muslims who have fled persecution in Buddhist-majority Myanmar. No more than 500 of those migrants are resettled in third countries each year.

The migrants who have made it this far just want better lives. "Whether I stay in Indonesia or Malaysia it doesn't matter, or even Australia or America. All I want is to get a job and find something to eat," said Muhammad Amin.

Thousands of migrants are believed to be stranded on similar boats in Southeast Asian seas as governments in the region seek to prevent them from landing, despite a request by the United Nations to rescue them. The United Nations said the deadly pattern of migration by sea across the Bay of Bengal would continue unless Myanmar ended discrimination.

Malaysia, Indonesia and Thailand have all turned or towed overcrowded migrant boats away from their shores in recent days, in what the IOM has described as "maritime ping-pong with human lives".