The Australian government has abandoned the country's controversial policy of jailing all asylum seekers.
Mandatory detention will now only apply to those who pose a risk to society or who breach their visa conditions.
Children and their families will no longer be held in detention centres, Chris Evans, immigration minister, said on Tuesday.
The immigration department would have to justify the detention of any refugees every three months, and an ombudsman would review cases of anyone held for more than six months, Evans said.
"A person who poses no danger to the community will be able to remain in the community while their visa status is resolved," he said.
He said a policy that locks away asylum seekers indefinitely while they go through the often complicated and time-consuming process of applying for refugee status was no longer acceptable.
No opening of gates
"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."
Evans said he would soon receive a departmental review of the cases of about 380 people who are now being held in detention and that the new policy would apply in each case.
Since taking over the immigration portfolio last year, he said, he had already reviewed the cases of 72 detainees who had been held for more than two years.
Of those, 31 should not have been detained and were on the way to obtaining visas, 24 would be deported and 17 people were still subject to legal proceedings, he said.
Asylum seekers arriving by boat will still be held at Australia's Christmas Island off the north west coast but with the aim of resolving their cases in the shortest time possible, Evans said.
Australia has long been a destination for people from developing countries.
In recent years, the majority of asylum seekers originate from Iraq or Afghanistan.
The government has already scrapped the highly criticised "Pacific Solution" under which refugees were sent to offshore detention centres in remote islands in the Pacific, without any access to the Australian legal system.