The new Australian government has abandoned the country's controversial policy of jailing all asylum seekers.
In a major overhaul of immigration rules, the policy of detaining would-be asylum seekers in often remote jails will now be used only as a last resort.
Children will no longer be held. Human rights groups have welcomed the move.
Earlier this year, Prime Minister Kevin Rudd ended the lengthy detention of asylum seekers on Pacific islands - a policy known as the Pacific Solution.
The strict policy of detaining asylum seekers and visitors who overstayed their visas was brought in by a former Labor government in the 1990s.
But it was its hard-line enforcement by Australia's conservative prime minister John Howard that drew criticism from groups like the United Nations Commissioner for Refugees.Deterrent to smugglers
In 2001, Mr Howard adopted a tough new stance called the Pacific Solution, which prevented asylum seekers from landing on Australian soil, and sent them instead to detention centres on small Pacific islands.
The policy even extended to children and followed the controversial Tampa Affair, a stand-off involving more than 400 mainly Afghan refugees, who were blocked from landing on Australian shores.
Now the new government has announced a complete overhaul of that approach.
Children will no longer be detained in immigration detention centres, while people deemed to pose no danger will be able to remain in the community while their visa status is being resolved.
The government will reserve the right to detain some people arriving illegally by boat - mainly as a deterrent to people smugglers - but immigration officials will now have to justify why they pose a risk that requires their confinement.
The human-rights group Amnesty International said the changes should result in the release of some 380 asylum seekers currently in Australian detention.
A spokesman said this would bring Australia into line with other Western democracies.
Immigration officials will have to justify the confinement of asylum seekers