July 16 (Bloomberg) -- It’s hard to imagine anyone rejoicing over being deported to war- and drought-ravaged Sudan. Yet there’s little doubt this fate came as a tremendous relief to Ibrahim al-Qosi.

For the past decade Qosi’s home had been a cell in the U.S. prison at Guantanamo Bay, Cuba.

His transfer to Khartoum on July 10 was the first of its kind under the Barack Obama administration and an indication of how much internment -- and military justice -- have improved at Guantanamo, and also of the hurdles that remain.

The 52-year-old Qosi presents no threat to national security; he had been a menial worker at Osama bin Laden’s Afghan training camps after 1996. In 2010, he reached a plea bargain with the tribunal, admitting to supporting terrorism in return for two more years of confinement. Sudan agreed to take him back after his release.

So, that’s one down and 168 prisoners to go. Another is poised to leave the prison, if only one of the U.S.’s closest allies will stop blocking his repatriation.

Omar Khadr is a Canadian citizen who was 15 when he was captured in 2002 in Afghanistan. In 2010 Khadr pleaded guilty to five charges, including murder, in a deal that made him eligible for transfer to a Canadian prison (and possible parole) after one year. In diplomatic notes to the U.S., the Canadian government indicated it would “favorably consider” Khadr’s return.

Now, however, Minister of Public Safety Vic Toews is singing a different tune, in fluent bureaucratese. Citing the need for a report from Canada’s prisons agency, he is refusing to formally ask for Khadr’s transfer, a diplomatic necessity. Rising public opposition is doubtless a factor -- 53 percent of respondents to an Abacus Data poll conducted in May considered Khadr a security threat.

Canada’s hesitation has had a dangerous ripple effect at Guantanamo. The chief U.S. prosecutor, Brigadier General Mark R. Martins, has wisely sought to reach plea bargains with detainees willing to testify against inmates considered higher up the al-Qaeda ladder. By leaving Khadr in limbo, Canada has jeopardized similar deals with other inmates.

One detainee, Soufiyan Barhoumi, a minor al-Qaeda figure from Algeria, is willing to testify against Abu Zubaydah, the Palestinian whom President George W. Bush accused of being al-Qaeda’s chief of operations. Yet Zubaydah, who has been held without charges for a decade and was waterboarded 83 times, has also been described by military and law enforcement sources as little more than a travel agent for the terrorist group.

Charging and trying Zubaydah could resolve the questions about his past and shed light on the torture he suffered. That seems less likely to happen without Barhoumi’s cooperation, which is contingent on repatriation to Algeria. His lawyer told the New York Times, “the fact that Khadr remains at Guantanamo beyond when he was supposed to be transferred is a significant hindrance in my client’s willingness to participate in negotiations with the government.”

The military tribunal system, after reforms in 2009, is finally starting to work, and the new emphasis on plea bargains is a big reason why. But that progress is at risk so long as Canada leaves Omar Khadr in his Cuban limbo.

Read more opinion online from Bloomberg View. Subscribe to receive a daily e-mail highlighting new View editorials, columns and op-ed articles.

Today’s highlights: the editors on why Jamie Dimon’s bonus should be clawed back and how to put more electric cars on the road; William D. Cohan on Romney’s magical IRA; Albert R. Hunt on the candidates’ need to spell out debt-cutting plans; Anthony Luzzatto Gardner on Bain Capital under Romney; Stephen Marche explains why Canadians are now richer than Americans.

To contact the Bloomberg View editorial board: view@bloomberg.net.