Former Guantanamo Bay prisoner Omar Khadr is to ask Alberta's youth court today to declare his eight-year sentence to have expired.

The sentence, which was imposed in 2010 by a military commission in the United States, would have ended last October had he remained in custody.

But the clock stopped ticking when an Alberta judge freed him on bail in May 2015 pending Khadr's appeal of a military commission conviction for war crimes — a years-long process that has no end in sight.

His lawyer, Nate Whitling, has said that the youth court judge has the authority to terminate the sentence and say it's over.

The Supreme Court of Canada ruled the punishment handed Khadr for alleged acts committed in Afghanistan when he was 15 years old was to be a youth sentence.

His application asks the judge to place Khadr under conditional supervision for one day then declare his sentence served.

One hurdle Khadr must overcome is proving the Alberta court has jurisdiction. The international treaty under which he was transferred to Canada from Guantanamo Bay could be interpreted as precluding such a review. If that view prevails, his application asks the judge to declare that part of the treaty unconstitutional.

Khadr spent years in U.S. detention at Guantanamo Bay after he was caught and accused of tossing a grenade that killed special forces soldier Christopher Speer at a militant compound in Afghanistan in 2001.

Since his release on bail, Khadr has lived in Edmonton and Red Deer, Alta., without incident. The court has eased some of his initial bail conditions, but several remain in place.

Those conditions include not having access to a Canadian passport, a ban on unsupervised communication with his sister who lives in Georgia, and a requirement to notify his bail supervisor before leaving Alberta.

Khadr's case has ignited divisive debate among Canadians over terrorism, human rights and the rule of law since it was revealed in the summer of 2017 that the federal government had settled a lawsuit filed by him for a reported $10.5 million.

The payout followed a ruling by Canada's Supreme Court in 2010 that Khadr's charter rights were violated at Guantanamo and that Canadian officials contributed to that violation.