The Supreme Court struck down one of Canada's most contentious anti-terrorism provisions on Friday, declaring it unconstitutional to indefinitely detain foreign terror suspects while the courts review their deportation orders.
The court ruled unanimously that the government had broken the Charter of Rights and Freedoms by issuing so-called security certificates to imprison people, pending deportation, without giving them a chance to see the government's case.
"The overarching principle of fundamental justice that applies here is this: before the state can detain people for significant periods of time, it must accord them a fair judicial process," Chief Justice Beverley McLachlin wrote on behalf of all nine judges.
"The secrecy required by the [certificates] scheme denies the named person the opportunity to know the case out against him or her, and hence to challenge the government's case," she added.
Critics compare the system to what is happening in the US prison in Guantanamo, Cuba, where hundreds of foreign captives have been held as suspected terrorists without trial and mostly without charges.
The Ontario jail housing those detained under security certificates has been dubbed "Guantanamo North."
The court suspended the ruling for a year to allow Parliament time to rewrite the relevant part of the Immigration and Refugee Protection Act -- under which the certificates are issued -- to address the court's concerns.
But it also said prolonged periods of detention could be allowed for foreign suspects if the new version of the law conformed with the Charter. The court ruled on cases brought by three Arab Muslim men who were detained between 2001 and 2003 on suspicion they were part of al-Qaeda.
"My name, my reputation -- I want them to be cleared. I am not a terrorist," said one of the men, Moroccan national Adil Charkaoui.
"I was never accused, I was never deemed guilty of a crime ... will they continue to harass me?" he told a news conference in Montreal. Authorities allege Charkaoui trained at an al-Qaeda camp in Afghanistan.
Ottawa says the men can leave the country at any time but must remain in detention or under very close watch until then because they pose too much of a threat. The men say they could be tortured if they are sent back to their countries of birth.
Charkaoui and Algerian Mohamed Harkat have been granted bail under very strict conditions.
The three men argued that it was unfair that they were being treated differently from Canadian citizens suspected of terror links, who have more legal rights.