A former teenage al Qaida fighter has been sentenced to eight more years in custody under a plea deal revealed after a military sentencing jury said he should serve 40 years for war crimes.

Omar Khadr looked straight ahead as a military judge at Guantanamo Bay in Cuba imposed the eight-year sentence.

The sentence ended a legal odyssey that began when the Canadian son of a major al Qaida figure was captured at 15 with severe wounds in Afghanistan in 2002, following a four-hour firefight.

Khadr, now 24, pleaded guilty on October 25 to five war crimes including murder for throwing a grenade that fatally wounded American special forces medic Sgt Christopher Speer.

Military prosecutors said it was no routine battlefield killing because the Canadian was not a legitimate soldier.

Sgt Speer's widow, Tabitha, pumped her fist and cheered "Yes!" when the jury announced its 40-year sentence. Then she burst into tears.

Under the terms of the plea deal, the US agreed to send Khadr - the last Western prisoner at the US military base at Guantanamo Bay - back to his homeland after one more year in custody. He has been held at Guantanamo for eight years. Toronto-born Khadr could have received up to life in prison if convicted at a trial of even one of the charges against him.

Melissa Lantsman, a spokeswoman for Canada's foreign affairs minister, would not speculate about when Khadr might return. She said a decision would be made only when he formally applied for a transfer and said he would be treated like any other Canadian.

The Khadr case has been one of the most scrutinised at the Guantanamo war crimes tribunals, with critics saying that a battlefield death should not be treated as murder and that Khadr - whose father was a confidante of Osama bin Laden - was a "child soldier" pushed into militancy by his family.

But prosecutors said he deserved no special protection and argued that his actions were war crimes because al Qaida fighters were not legitimate soldiers who followed internationally-accepted principles of war.