When Kashif Ali learned that he was being released from maximum security prison, he started crying in the courtroom.

The West African man spent the last seven years in jail under Canada's system of indefinite immigration detention while the government tried to deport him.

"There's no words for it," Ali said of the moment on Friday he learned he would be released. "I went through a lot, I thought there was no end to it."

Ali, who says he was born in Ghana but never received documentation, has found himself in legal limbo because neither Ghana nor Nigeria, where his mother was born, will recognize his nationality.

He told Metro Morning he's always been willing to be deported to either country, rather than continue to languish in prison or stay in Canada without a work permit.

No limit to detention length

Ali's lawyer Jared Will said his client's prolonged detention was possible because Canada "has no legislative maximum for the amount of time people can be detained."

"Inertia tends to take over," he said. "Nobody wants to admit that prior detentions were unjustified, so detention gets maintained."

Jared Will

Lawyer Jared Will represented Kashif Ali, arguing that his prolonged detention was unjust. (CBC)

The federal government justified his detention on the grounds of public safety. Ali has string of convictions dating from the 90s and early 2000s and the government considered him a danger to the public.

While delivering his decision on Friday, Superior Court Justice Ian Nordheimer dismissed the idea that those charges warranted ongoing detention, calling Ali's seven-year-long ordeal "unacceptable."

Ali still living in limbo

Now living with his daughter's grandmother, Ali's status remains in doubt — Will doubts that Ghana or Nigeria will change their minds and issue him a travel document, and he has no status in Canada.

Nordheimer has recommended that he be issued a work permit and health coverage, something Ali said he could badly use.

"I went through a lot, I spent a lot of time in segregation [while in prison,] so I would like to seek help for that,"  said Ali.

He would also like to seek out addiction treatment. 

End Immigration Detention Network, a coalition opposed to immigration detention, is pushing for the end of indefinite detention and the introduction of a 90-day limit for immigration detainees, an end to maximum security imprisonment, and a revamp of the judicial oversight process.

Will and the Network have taken the issue to the Federal Court of Canada, which will hear their arguments on May 15.

With files from Metro Morning