During the 18 years he has lived in Austria, Dulal D'Costa supported himself by selling newspapers in a retirement home, but due to the lack of a passport, was unable to obtain better-paid work legally or travel overseas.
The Federal Administrative Court held a hearing on Monday in which D'Costa withdrew his application for asylum, and was instead granted residence on humanitarian grounds.
The 38-year-old held the record for the longest running asylum case in Austria, having arrived from Bangladesh in 1996 at the age of 20.
He had received death threats for joining student protests as part of the anti-communist Bangladesh Nationalist Party in his home country, and one of his friends was killed.
When interviewed in June, D'Costa explained the impact that being kept in a legal limbo had on his life. "I don't see a future. I can't find a girlfriend, I can't get married and have a child, because if there is a negative decision about my case, then I will need to leave the country."
After nine years, D'Costa received the first decision on his case, which was negative. His appeal was rejected. A final hearing was held last autumn, but no interpreter was provided. Many of the residents of the retirement home offered to testify on his behalf.
D'Costa's lawyer, Andreas Lepschi said: "This is not an asylum procedure, rather a denial of the asylum procedure."
Lepschi added that it was difficult to say "forget it, all's well that ends well", because the asylum issue had not been decided. The result was therefore "not a complete success", he said.
D'Costa has been issued a residence card for a period of only one year, which has to be renewed.
The Federal Administrative Court told the Austrian Press Association that D'Costa's asylum application was a "very unfortunate individual case". He deserved to be awarded residency on humanitarian grounds, it said, and the case should now be considered as complete.