EDMONTON -- 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 ticking 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 has told an Edmonton court that Khadr served three years and five months in custody and has been free on bail for another three years and nine months.

The Crown argued Khadr should serve the remainder of his sentence in the community.

Chief Justice Mary Moreau says she will hand down her decision March 25.