A Canadian judge has ordered the release of a former Guantanamo Bay inmate while he appeals his conviction for war crimes, including killing a U.S. soldier.

The judge, June Ross, said Friday that the terms of Omar Khadr's release will be determined May 5.

Toronto-born Khadr is in prison in Alberta, serving out an eight-year sentence handed down by a U.S. military commission in 2010. He was convicted of five war-crimes, including throwing a grenade when he was 15 years old that killed Army Sgt. 1st Class Christopher Speer in Afghanistan.

Ross said Khadr, now 28, has a strong basis for appeal and keeping him behind bars would not be in the public interest.

The government has argued that granting Khadr bail would undermine Canada's international relations and obligations.