Updated

Canada's Supreme Court ruled Friday that it will not force the government to seek the repatriation of the youngest detainee held by the U.S. at Guantanamo Bay.

Conservative Prime Minister Stephen Harper has steadfastly refused to request the return of Canadian-born Omar Khadr, the last Western detainee held at the prison at the U.S. Navy base in Cuba. Harper has said the U.S. legal process must be allowed to play itself out.

The Supreme Court ruling Friday overturns a lower court ruling that ordered the Canadian government to seek Khadr's return. The top court's nine judges unanimously ruled that Khadr's constitutional rights were violated, but left it to Canada's government to decide the proper remedy.

Khadr, who was born in Toronto, is now 23 but was only 15 when he was captured after allegedly killing an American soldier in a 2002 battle in Afghanistan. Authorities say his family has close links to Al Qaeda.

Government lawyers argued the courts did not have the right to order authorities to seek Khadr's repatriation because it put them in the realm of diplomacy.

The court agreed, saying in its written decision that "the proper remedy is to grant Mr. Khadr a declaration that his ... rights have been infringed, while leaving the government a measure of discretion in deciding how best to respond."

Khadr's lawyers argued Canada was complicit in his alleged torture and maintain that Harper is obliged under international law to demand the prisoner's return so as to protect children and child soldiers and to repudiate torture. The U.S. has assured Canadian authorities that Khadr has been treated humanely. Canadian officials questioned Khadr at Guantanamo and shared the results of their interrogations with U.S. authorities

In April, a Canadian judge ruled that Harper's refusal to request Khadr's repatriation offends a fundamental sense of justice and violates his constitutional rights. Canada's Court of Appeal dismissed the government's appeal of that decision this past summer by a majority 2-1 decision. Friday's ruling overturns those decisions.

Khadr, the son of an Egyptian-born father and Palestinian-born mother, has said through his lawyer that he would be willing to face prosecution in Canada and undergo a transition period away from his relatives, who have Canadian citizenship but have been linked to Al Qaeda.

Canada's three opposition parties have demanded that Harper's Conservative government bring Khadr home.

Khadr has received some sympathy from Canadians, largely due to his age and the torture allegations, but his family has been widely criticized and called the "first family of terrorism."

The human rights group Amnesty International said it disagreed with the ruling.

"I'm disappointed. Clearly from Amnesty's perspective we didn't this as an issue of improper intrusion into foreign policy, we saw this as a decision that's all about protecting human rights," said Alex Neve of Amnesty International Canada. "The court saw otherwise. That's unfortunate but we nonetheless have a very strong ruling on the human rights front."