The National Court in Papua New Guinea has issued an injunction stopping the deportation of the Manus Island asylum seeker Assam el Sheikh.
Mr El Sheikh physically resisted two attempts to move him from Manus, sustaining severe injuries in alleged beatings by security forces.
An attempt to deport him to Lebanon last week was blocked by a doctor who found the 29-year-old had suffered kidney damage and was unfit to fly.
Refugee advocate Marilyn Beech said a Port Moresby lawyer obtained the injunction in a special Sunday sitting of the court.
She said the lawyer was challenging the process that resulted in Mr El Sheikh being given a negative refugee status.
"We think Azzam's case could be a forerunner for a much larger legal case involving all the men who've been found to be negative," said Ms Beech.
More than 200 hundred of about 900 men held on Manus Island have been denied refugee status.
The advocate said the court had also orderd Mr El Sheikh be released from prison.
After four years in the Australian run detention centre on Manus, Mr El Sheikh has been incarcerated for 34 days without charge in the Lorengau police lock up and Port Moresby's Bomana prison.
"The court has ordered his release. It's a matter of us having a place to take him and being able to take him out of there," said Ms Beech.
She said Mr El Sheikh fears for his life if he is sent back to his country of origin and has refused an offer of $US25,000 to be voluntarily repatriated.