By Jonathan Kent
BBC correspondent in Kuala Lumpur
An exodus of illegal migrants has begun in Malaysia after a government-declared amnesty allowing undocumented foreigners to leave without penalty.
Thousands of Indonesians are taking advantage of the amnesty
Tens of thousands of mostly Indonesian workers are expected to head home over the next two weeks.
The move is part of Malaysia's attempts to better regulate its huge population of foreign workers.
Meanwhile the government is reportedly due to formalise the status of the many Burmese Muslim refugees in Malaysia.
Queues have started to form at ferry terminals, just as they have in recent days outside embassies, where undocumented workers collected the papers that allowed them to leave.
The amnesty is timed to coincide with the last two weeks of the Muslim fasting month of Ramadan, which ends in mid-November.
There are thought to be as many as three million migrant labourers in Malaysia, more than 10% of the population.
Half of them are said to be in the country illegally.
A similar exercise two years ago saw the departure of around 300,000 people, mostly to Indonesia, and the exercise strained diplomatic relations between the two nations.
After the amnesty expires, undocumented workers can again expect to face fines, jail and flogging.
Earlier this year the government announced that it would train members of its reserve corps to help round them up.
However there seems to be better news for thousands of Muslim ethnic Rohinge refugees who fled to Malaysia from Burma.
Next week the government is expected to announce details of a scheme that would give them identity cards and allow them to work.
Malaysia does not recognise the status of refugees, and Burma refuses to accept them back. For years the Rohinge community has been left stateless.
Other refugee groups, including thousands of Achenese, are not expected to benefit from the move.