Omar Khadr, once a Guantanamo Bay inmate, granted bail in Canada
A US soldier walks next to the razor wire-topped fence at the abandoned "Camp X-Ray" detention facility at the US Naval Station in Guantanamo Bay, Cuba, April 2014 (AFP Photo/Mladen Antonov)

Omar Khadr, a Canadian who was once the youngest prisoner held in the Guantanamo military base before being transferred to a prison in the province of Alberta in 2012, has been granted bail and could be released early next month while he appeals his murder conviction by a U.S. military tribunal.

Khadr, now 28, was captured in Afghanistan when he was 15. He pleaded guilty to killing a U.S. soldier and has been incarcerated since 2002. He will be released from a prison near Innisfail, Alberta, on May 5, when a judge will set the conditions of his release, said his lawyer, Dennis Edney.

"I hoped that justice would prevail and it did," Edney said. "We'll have a date with a judge in coming weeks and we'll talk about conditions of release."

The right-wing Canadian government of Prime Minister Stephen Harper, which has consistently opposed any effort to free the one-time child soldier, said it will contest the ruling.

"We are disappointed and will appeal this decision," Public Safety Minister Steven Blaney said in a statement.

"Omar Ahmed Khadr pleaded guilty to heinous crimes, including the murder of American Army medic Sergeant Christopher Speer. We have vigorously defended against any attempt to lessen his punishment for these crimes."

The Canadian Supreme Court ruled in 2010 that Canada breached Khadr's rights by sending intelligence agents to interrogate him in at the U.S. naval base in Guantanamo Bay, Cuba in 2003 and 2004 and sharing the results with the United States.

Khadr was the first person since World War Two to be prosecuted in a war crimes tribunal for acts committed as a juvenile. He was the youngest prisoner still at Guantanamo, but younger boys were previously held there.

Canadian-born Khadr was taken to Afghanistan by his father, a senior al Qaeda member who apprenticed the boy to a group of bomb makers who opened fire when U.S. troops came to their compound. Khadr was captured in the firefight, during which he was blinded in one eye and shot twice in the back.

His sentence was to expire in October 2018.

(Reporting by Scott Haggett; Editing by James Dalgleish)