The Court of Appeal in Ontario, Canada, has ruled that the five years a mentally ill man spent in maximum-security immigration custody before being deported to Jamaica did not amount to cruel and unusual punishment.

In upholding an earlier decision, the Court of Appeal yesterday agreed Alvin Brown's lengthy detention was neither arbitrary nor indefinite, and concluded he had no claim to damages in the case.

Canadian media report that the Appeal court said although the Canada Border Services Agency encountered a number of problems and the delays were significant, these were largely caused by the Jamaican authorities.

Brown arrived in Canada in 1983 as an eight-year-old and became a permanent resident in 1984.

The federal government revoked his residency status in 2005 and ordered him to leave following a string of convictions.

Canada Border Services Agency detained him in early 2011 after he had served his time pending his removal.

He spent the next five years in a maximum security prison trying unsuccessfully to have the removal order quashed.

During that time, immigration officials tried to ensure he had the necessary travel documents.

Jamaican officials wrangled over whether he was in fact a citizen and then raised questions over his mental-health needs.

Ultimately, the Jamaican government issued him travel papers and he was deported in September 2016 as his lawyers argued the father of six, who is in his 40s, deserved damages of CAD$1,500 for each day he had spent in immigration detention.