An Iranian asylum seeker who's spent eight years held at detention centres across Australia will be sent offshore by Federal Court order.
But before Ned Emeralds, 36, leaves the mainland, he will live in suburban Perth under the guard of a round-the-clock Home Affairs officer.
A judge ordered that Mr Emeralds, who arrived by boat in July 2013, be taken to Nauru, and until that occurs, that he live with friends.
"It is evident that the applicant regards liberty in Nauru as preferable to detention in Australia," the judge wrote.
During his time in detention, Mr Emeralds has been held at facilities in Darwin, Perth, regional Western Australia, Melbourne, Brisbane and Sydney.
"When the Navy dragged our boat from the open seas to Australian waters, I never thought I'd be locked up for almost a decade in the name of 'protection'," Mr Emeralds told AAP.
His court file shows that he applied for a protection visa in 2015.
"I should have been released in 2016, when my protection visa application was accepted and when I was known as a refugee.
"I feel I have been punished for seeking freedom. The minister re-assessed my claim and rejected it."
Mr Emeralds describes his situation as a "life in detention".
"The detention life taught me not to plan for freedom as it's stressful and depressing dream," he said.
Mute following a suicide attempt while in detention, Mr Emeralds was represented by lawyer Sanmati Verma, who said "this was the first time the court has seen fit to direct both the location and the conditions of a refugee's detention".
"The court has never previously made an order of this nature because immigration detention has always been considered a matter for the government."
The judge found the government was at fault for the man's wrongful onshore detention.
"The cause of prolonged detention of the applicant in detention centres in Australia is the (Department of Home Affairs) secretary's refusal or failure to perform the duty required," the judge said.
"It is not through the fault of the applicant."
Given "that incarceration in detention centres is having a significant effect upon the applicant's mental health" and noting "it could be weeks, or months, or longer" until he is transferred to Nauru, the judge approved suburban detention.
Ms Verma said the court cannot end the man's detention because "he is an unlawful citizen".
The court was told of a couple who live alone in a six-bedroom house in Perth.
"They would be happy to have the applicant live with them free of charge for as long as is required," the judgment read.
"They are also willing and able to pay for his food and other daily consumption needs."
The couple is content to have Home Affairs officers stationed at their home, to make sure the man doesn't leave the property.
Lifeline 13 11 14
beyondblue 1300 22 4636
Australian Associated Press