Australia's highest court has thrown out a challenge to the lawfulness of the country's offshore detention of asylum seekers.
The judgement opens the way for Canberra to send 267 people - including 37 babies who were born in Australia, a five-year-old boy who was allegedly raped at a detention centre, about 50 other children, and women who were sexually abused - back to Nauru.
The case was taken to the High Court of Australia by the Melbourne-based Human Rights Law Centre on behalf of the asylum seekers, who had been transferred to Australia for medical treatment or to give birth.
It argued offshore detention infringed constitutional limits on power, and there was no law that gave the Australian government the authority to facilitate offshore arrangements.
But the court's decision, announced by a full bench today, and unable to be appealed, found the federal government's conduct was authorised by both the law and the Australian constitution.
Hear more on Dateline Pacific
The asylum seekers' lawyer, Daniel Webb, said 267 people were now terrified they would face immediate deportation to Nauru.
"The legality is one thing, the morality is another. Ripping kids out of primary school and sending them to be indefinitely warehoused on a tiny remote island is wrong," he said.
Hear more from Daniel Webb
A senate inquiry into the Nauru camp last year heard of a culture of physical and sexual abuse at the centre, and conditions likened to that of torture.
It heard five to six families lived together in each communal tent, which were filled with mice and cockroaches, no air conditioning, and mould that caused skin infections.
The inquiry was told women and children were forced to wet the bed, as they were too afraid to go to the bathroom at night for fear of their safety, and that there were just four toilets for 400 people to share.
The inquiry also heard about a seven-year-old girl who attempted suicide, and a teenager who sewed his lips shut in protest.
Asylum Seeker Resource Centre spokesperson Pamela Curr said Australia sending people back to such conditions was against its international human rights obligations.
"Since when is a wealthy, democratic country like Australia asserting for itself the right to send children, women, men, to a place where they face violence, all sorts of persecution - and that's what they face on Nauru. The Nauru government don't want them, there's no future for them there."
Ms Curr said many of the asylum seekers were sent to Australia to receive urgent medical attention, but Nauru did not have the capacity to provide proper care.
"We've got a film footage of the Nauru hospital as it operates right now - with wild dogs running through it, rusty, run-down, no proper sterilising facilities, no proper investigation facilities. I mean, it's just a joke," she said.
Under the 1958 Migration Act, the Australian government is able to use its discretionary powers to allow the children and families party to the High Court case to remain in Australia.
Save the Children spokesperson Lee Gordon, who has worked on Nauru, urged Australian prime minister Malcolm Turnbull to show compassion and allow the asylum seekers to stay in the country.
"Mr Turnbull indicated last year that he was very concerned about asylum seekers languishing in Australian-run detention centres, and we are really urging Mr Turnbull to exercise some compassion and make good on his concerns, and allow these people to reside in Australia in safety."
The offshore detention regime, reintroduced in 2013, is supported by both of Australia's main political parties, but has been widely condemned by human rights groups and the UN.
Following the verdict, the Australian Greens said if Mr Turnbull sent the children back to Nauru it would amount to "child abuse".
Greens immigration spokesperson Sarah Hanson-Young said this was the first major test for Mr Turnbull.
"Will he keep these children safe, where they can thrive and prosper, or will he dump them back on the prison island of Nauru?
"The Immigration Minister has made his position clear. He wants to send these children back to the hell of Nauru as quickly as possible. For the families and young children who have been caught up in this mess, I hope that doesn't happen.
"Malcolm Turnbull and Bill Shorten both need to make their position on this clear. Do they support the Nauru camp and the plans to send these children there?"
It is not known when the government intends to send the 267 asylum seekers back to Nauru, but by law, they will get 72 hours notice from the government of deportation.
Australian Minister for Immigration and Border Protection Peter Dutton could not be reached for comment.