A new immigration law comes into effect in Japan on Friday.
Under the new regulation, those who are caught after entering Japan illegally face possible criminal charges, causing alarm among the country's growing population of undocumented immigrants.
Over the past few weeks the main immigration office in Tokyo has been inundated by thousands of desperate people who have been trying to avoid new penalties.
Most are immigrants from other Asian countries like China and the Philippines who have been working here for years without official permission.
Under the new law, illegal immigrants can no longer avoid the possibility of being fined or imprisoned after being here for three years.
And once deported, they are now going to be banned from coming back for five years.
Lawyers say that in practice the impact on most illegal aliens will not be very different.
Only a few are likely to be prosecuted and most probably won't ever be caught.
But the new law has been so poorly explained that there is fear and confusion among the more than a quarter of a million undocumented immigrants.
So they are turning themselves in to the authorities in the hope of more lenient treatment.
Japan has in the past strictly controlled immigration and immigrant communities are still relatively small and inconspicuous compared to other industrialised countries.
But their numbers are growing as Japanese companies seek cheaper labour from abroad for the jobs the Japanese no longer want to do.