Immigration officials will have to justify the confinement of asylum seekers
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, and adults who are detained will have their situation evaluated every three months.
Immigration Minister Chris Evans called the decision a move towards "more humane" treatment of asylum seekers.
Human rights groups welcomed the announcement.
Amnesty International called the reforms a "welcome step forward" that would bring Australia's system "into line with other Western democracies".
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 conservative leader John Howard that drew criticism from rights groups and the United Nations.
In 2001, Mr Howard adopted a policy which prevented asylum seekers from landing on Australian soil and sent them instead to detention centres on small Pacific islands.
Some will regard this as a moral corrective, similar in spirit and application to the apology to Aboriginal Australians for past injustices
The policy, called the Pacific Solution, led to protests and hunger strikes from the detainees.
Earlier this year, fulfilling a campaign pledge, the new Labor government formally ended the Pacific Solution. Now it has announced further reforms.
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. "This isn't about a mass opening of the gates, this is about a more humane treatment of asylum seekers, a more humane detention policy," Mr Evans said.
"We think this will allow us to maintain strong border security but also treat people with human dignity."
The policy would apply to a review of the cases of about 380 people currently in detention, he said.
Amnesty International's campaign coordinator Dr Graham Thom praised the move.
"This will help repair the harm done to our international reputation by previous policies, where prolonged detention caused irreparable damage to both the physical and mental health of those detained," he said in a statement.
But he called for further steps to be taken, including the closure of the remote Christmas Island detention centre.