Omar Khadr, a Canadian who was once the youngest prisoner held on terrorism charges at Guantanamo Bay, was released on bail from an Alberta prison Thursday while he appeals a murder conviction by a U.S. military tribunal.

A judge in an Alberta court ruled that Khadr, who was captured in Afghanistan when he was 15 and pleaded guilty to killing a U.S. soldier, can be released on bail, denying an appeal by the Canadian government to keep him in custody.

Khadr, 28, who was transferred to Alberta from a U.S. naval base prison at Guantanamo Bay in Cuba in 2012, emerged from his lawyer's home Thursday evening to neighbors' cheers.