An Alberta judge is to rule next month whether former Guantanamo Bay prisoner Omar Khadr should have his eight-year sentence for war crimes declared expired.

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

But the clock stopped when a judge freed him on bail in 2015 pending Khadr's appeal of his military conviction -- a years-long process that has no end in sight.

His lawyer, Nathan Whitling, told an Edmonton court that Khadr served three years and five months in custody and has been out on bail for another three years and nine months.

He said the appeal, in the meantime, hasn't advanced "even an inch" in the U.S.

"Mr. Khadr's sentence essentially is frozen in time," Whitling told Chief Justice Mary Moreau on Tuesday.

The Toronto-born Khadr spent years in U.S. detention at Guantanamo Bay after he was captured and accused of tossing a grenade that killed special forces soldier Christopher Speer in Afghanistan in 2002.

He was later transferred to an Edmonton prison and the Supreme Court of Canada ruled the punishment handed Khadr for the acts committed when he was 15 years old was to be a youth sentence.

His application in youth court Tuesday asked the judge to place him under conditional supervision for one day then declare his sentence served.

Since his release on bail, Khadr has lived in Edmonton and Red Deer, Alta., without any issues.

"He's been an upstanding citizen since being released," said Whitling. "There's just nothing negative to say about Mr. Khadr."

Another judge had 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 the former Soviet republic of Georgia, and a requirement to notify his bail supervisor before leaving Alberta.

Both federal and provincial Crown lawyers said Tuesday that Khadr should serve the remainder of his eight-year sentence in the community with similar conditions.

"We have no objection to the applicant not serving time in custody," Alberta Crown prosecutor Doreen Mueller said in court.

"The remainder of the sentence has to be served.

"The sentence is the sentence."

Federal Crown prosecutor Bruce Hughson added any reduction in the sentence would go against the international treaty under which Khadr was transferred to Canada.

"Canada cannot, under its treaty obligations, alter the length of the sentence," he said. "What they do allow is an alteration of the length of confinement."

Hughson said he understands Khadr's frustration with the appeal process, but suggested Tuesday's application should have been made by lawyers at the same time as the bail application in 2015.

"The fact is they didn't," he said.

Whitling said they made a tactical decision to seek bail in 2015 without dealing with the sentence.

"Hindsight is always 20/20," said the defence lawyer.

He added that the Crown was blowing Canada's international obligations out of proportion.

"What the United States agreed was that you can treat transferred youth prisoners just like you do your own youth

prisoners," he said outside court. "It wouldn't surprise them at all ... to learn that this type of review exists.

"I don't take seriously that somehow the relationship between the two countries would be negatively affected by this decision."

Moreau said she will hand down her decision March 25.