Omar Khadr should be serving his time in a provincial facility and must be transferred from federal prison, the Alberta Court of Appeal ruled Tuesday.
Khadr, a Canadian who pleaded guilty in a U.S. military court to war-crimes charges, would have been sentenced as a youth had he been in Canada, the judges wrote. That means Khadr would have served his time in a provincial jail, the judges said, and should be sent there now.
The federal government says it will appeal the ruling and seek a stay of the transfer order.
Khadr, 27, was transferred to Canada in September 2012 under the International Transfer of Offenders Actto serve out the remainder of his eight-year sentence, which ends in October 2018.
"We conclude that Khadr ought to have been placed in a provincial correctional facility for adults," wrote Justices Catherine Fraser, Jack Watson and Myra Bielby.
"In summary, the eight-year sentence imposed on Khadr in the United States could only have been available as a youth sentence under Canadian law, and not an adult one, had the offences been committed in Canada."
Dennis Edney, Khadr's longtime lawyer, said the federal government "chose to misinterpret" the international transfer of offenders law.
"We are pleased to get Omar Khadr out of the hands of the Harper government. This is a long series of judgments against this intractable, hostile government.
"It would rather pander to politics than to apply the rule of law fairly to each and every Canadian citizen," Edney said in a statement.
Khadr spent the first seven months of his time in Canadian prison in solitary confinement, Edney noted.
In a later interview on CBC News Network, Edney said the ruling means "the law is on [Khadr's] side."
"That he is to be treated as a youth and be afforded rehabilitation programs and perhaps a better treatment," Edney said of his expectations for Khadr's new incarceration regime.
Edney said Khadr's transfer to a provincial facility could normally occur within a few weeks.
But the federal government said in a statement it would appeal the ruling "and seek a stay to ensure that [Khadr] stays in federal prison — where he belongs."
"Omar Ahmed Khadr pleaded guilty to heinous crimes, including the murder of American army medic Sgt. Christopher Speer. We have vigorously defended against any attempt to lessen his punishment for these crimes," Public Safety Minister Steven Blaney said in the statement.
"We do not agree that a youth sentence is appropriate for someone who is seen on video making the same type of improvised explosive devices that killed many of the 158 Canadian Armed Forces members who died in Afghanistan," the statement said.
Françoise Boivin, the NDP's justice critic, said the court found that Khadr should have been sentenced as a youth and the decision should be respected.
"The Conservative government is starting to cost us a lot of money in all their court challenges that they seem to lose one after the other," she said.
Khadr was detained in 2002 at age 15 after a deadly firefight in Afghanistan between U.S. forces and militants, in which a U.S. soldier was killed. Khadr was declared an unlawful enemy combatant and charged by the U.S. in 2005.
He agreed to plead guilty to five offences in 2010, shortly after the start of his trial at the U.S. military base in Guantanamo Bay, Cuba, in exchange for assurances his sentence would not exceed eight years.
After his transfer in 2012, Khadr was sent to Millhaven Institution near Kingston, Ont., before being moved to the Edmonton Institution and later Bowden Institution in Innisfail, Alta.
Khadr challenged his detention in the federal system, filing an application for habeas corpus. That application was rejected by the Alberta courts.
But in Tuesday's ruling, the judges found that a lower court judge erred when he ruled Khadr was serving five concurrent sentences, and that four of them were adult sentences, meaning he could be held in a federal institution.
Mobile users, read the Alberta Court of Appeal ruling here