A Canadian court has ruled that a former Guantanamo Bay detainee Omar Khadr sentence has expired.
The Canadian citizen spent a decade in the infamous US military prison for war crimes allegedly committed when he was a young teenager in Afghanaistan.
In 2012 he was repatriated to a Canadian prison, and was released on bail in 2015.
Monday's court ruling means he will no longer have conditions on his release and he will be a free man.
"I think it's been a while but I'm happy it's here, and right now I'm going to just try to focus on recovering and not worrying about having to go back to prison, or, you know, just struggling," Khadr said outside the Alberta court.
Khadr, who was born in Toronto, was taken to Afghanistan by his father, a member of the al-Qaeda terror network. He was captured in Afghanistan in 2002 during a fire fight between US soldiers and the Taliban, when he was 15.
He spent the next decade in Cuba at Guantanamo Bay.
Khadr was convicted in 2010 by a US military commission of killing US Army Sgt Christopher Speer, and other war-related crimes.
That same year, Canada's Supreme Court ruled his constitutional rights had been violated, holding that Canadian officials had been complicit in Khadr's mistreatment and had contributed to his ongoing detention in Guantanamo.
In 2012 he struck a plea deal and was transferred to a prison in Alberta, Canada.
He was released on bail in 2015. He sued the Canadian government for violating his constitutional rights.
Khadr has since recanted his confession, maintaining it was made under duress. He is appealing his conviction in the US.
Canada formally apologised to Khadr in 2017 and paid him a C$10.5 million ($8m; £6m) settlement.
His case has long divided public opinion. His defenders describe him as a child soldier. Others argue he was a radicalised fighter.