Peter Qasim remained in a hospital on Sunday where he has been treated for depression but Immigration Minister Amanda Vanstone said he was free to leave. 

"He will probably stay there until his particular doctors are working, which will be on Monday, and he'll make a decision with them what he does. But the plain facts are, at law he's entitled to walk out," Vanstone said. 

Qasim's long detention has cast a spotlight on Australia's tough immigration policy, where illegal arrivals are detained in tightly policed camps condemned by international human rights group. 

Qasim says he is an Indian national from the disputed Himalayan territory of Kashmir but Australia has been unable to verify his identity and India has refused to accept him back. 

Vanstone said a month ago that Qasim would be one of 50 asylum-seekers detained for two years or more who would be offered visas allowing them to live outside of detention centres until their cases could be successfully finalised. 

Vanstone said Qasim's visa had been finalised on Saturday.