A deal to send 800 asylum seekers in Australia to Malaysia in exchange for 4,000 refugees is to be signed on Monday, a Malaysian official has said.
The home ministry official said the one-off exchange of boat people would be formally agreed in Kuala Lumpur.
Many refugee claimants held at Australia's Christmas Island detention centre have expressed frustration at long delays and overcrowding.
Inmates have held a third night of violent protests there, police say.
A spokesman for Australian Immigration Minister Chris Bowen said of the deal: "It's close, we will be able to say more in coming days."
The UN has previously criticised Australia for holding all asylum seekers while their applications are assessed.
The migrants are held for months at the Christmas Island centre, about 1,500 miles (2,400km) from the Australian mainland, and in other facilities.Malaysia is home to tens of thousands of illegal migrants and is not a signatory to UN conventions on refugees.
Australia currently has more than 6,000 asylum seekers in detention, originating from countries including Iran, Iraq, Vietnam, Sri Lanka and Afghanistan.
Last year, more than 25,600 refugees registered with the UNHCR in Malaysia to seek asylum, the highest among all countries where the refugee agency has offices.
Meanwhile, immigration officials said there had been "another significant incident" at the Christmas Island centre overnight involving up to 100 detainees.
"The detainees used improvised weapons and lit a number of fires in a number of locations within the centre," a police spokeswoman told AFP.
Refugee advocate groups said some detainees lay in shallow graves to symbolise their desperation.
"Asylum seekers in the Green compound have dug shallow graves in the courtyard of their compound," said refugee advocate Ian Rintoul, who keeps in regular telephone contact with detainees at the centre.
"Some asylum seekers have already staged mock burials and buried themselves up to their necks in a symbolic protest that detention is killing their bodies and their minds," he said.