By Jonathan Kent
BBC News, Kuala Lumpur
Malaysia is to relax immigration rules to allow former illegal migrant workers to visit the country to seek work.
Malaysia has an uneasy relationship with its immigrants
The move comes just weeks after the Malaysian government launched a huge operation to expel the workers.
Malaysia's policy on foreign workers has become so muddled that critics are saying it is barely worth the name.
Having persuaded illegal migrants to leave with a threat of fines, jail and whipping, the government now desperately wants them back.
It has even set up centres in Indonesia, where most of the workers came from, to speed their return as legal employees.
But high charges levied by the Indonesian government for processing work permits seems to have deterred the workers and the centres recently closed.
So Malaysia will now allow the Indonesians to enter the country on tourist visas, without the promise of employment, to seek work once they arrive.
It is an embarrassing U-turn from a government that wanted to make political capital from its tough stance on illegal immigration - and a sign of just how badly Malaysia's labour shortage is biting.
Undocumented migrants made up more than a 10th of its workforce and factories, restaurants and construction companies have been hit hard.
After it became clear that the Indonesian authorities were at best reluctant to help workers return to Malaysia, the government in Kuala Lumpur looked to other countries, including Pakistan, Nepal, India and Sri Lanka.
However, a host of issues, including security, language problems and the logistics of replacing more than half a million workers quickly has forced Malaysia to turn to Indonesia once more.