TORONTO - Canada's rules for detaining foreigners who can't be deported quickly are constitutional, the Federal Court of Appeal has found, rejecting an argument there should be time limits for detention in immigration cases like there are for criminal trials.

In a decision released this week, the Appeal Court upheld a lower court ruling to dismiss the constitutional challenge filed by Alvin Brown, a man who was detained for five years in Canada before being deported to Jamaica.

Brown, who has schizophrenia, was stripped of his permanent residency after a series of largely drug- and weapons-related convictions, and was ordered detained pending removal in 2011 because he was deemed both a danger to the public and a flight risk.

However, Jamaica long refused to issue travel documents, so Brown remained in an Ontario correctional facility until the fall of 2016, when he was deported.

In their appeal, his lawyers argued the immigration detention regime violates several sections of the Canadian Charter of Rights and Freedoms, including those related to life, liberty and security of the person and the right not to be arbitrarily detained.

Among other arguments, they invoked the 2016 Supreme Court of Canada ruling known as the Jordan decision, which set strict time limits for criminal trials, and called for similar, judicially mandated caps on the length of detention in immigration cases.