(Note: CBC does not endorse and is not responsible for the content of external links.)

Just under 270 of an estimated 775 inmates remain at the detention facility at the U.S. naval base in Guantanamo Bay, Cuba. Most of the original inmates have been released without charge. Around 20 face trial by the controversial military commisions process, including Canada's Omar Khadr. ((Brennan Linsley/Associated Press))

From the early days of the U.S.-led invasion of Afghanistan in October 2001, Washington's war planners had a problem.

What to do about suspected enemy captives in U.S. military custody?

Some had been arrested by American soldiers on the field of battle; many were turned over to U.S. troops by Afghan allies and warlords; a few were rounded up by bounty hunters tempted by big rewards offered for terror suspects. The captives were from places as disparate as North Africa, Saudi Arabia and even Bosnia.

The Sept. 11, 2001, attacks were a painful and frightening recent memory, and President George W. Bush said the U.S. was in a "war on terror."

So, were the captured men prisoners of war by international definition?

No, said Washington, because they wore no uniforms and were not part of any recognized military force. That meant, the U.S. contended, they didn't qualify for protection under the international rules of war, which are supervised by the Red Cross under the rubric of the Geneva Conventions and Protocols.

Broadly, those rules mean soldiers can't be tried for simply fighting enemy forces. Nor can they be held inhumanely or interrogated beyond establishing their identity.

Now, with President Barack Obama signing an order on Jan. 22, 2009, that will see the detention centre at Guantanamo Bay in Cuba closed within a year, the future of the 245 male prisoners left on the island, including Canadian Omar Khadr, is up in the air.

Enemy combatants' rights limited: U.S.

From the beginning, U.S. officials argued the men in custody at Guantanamo Bay were illegal enemy fighters who had few legal rights and could be questioned — roughly if necessary — about their possible links to Islamist militancy.

In this image reviewed by the U.S. Military, a bulletin board includes a posting of Geneva Convention rights and rules for detainees at the detention facility at Guantanamo Bay U.S. naval base in Cuba. ((Randall Mikkelsen, Associated Press))

The first prisoners began to arrive at the once-obscure U.S. naval base in southeast Cuba in 2002. The U.S. announced its intention to try them using military commissions, a process usually intended for dispensing battlefield justice to captured combatants or suspected war criminals caught outside the United States.

The process hadn't been used since just after the Second World War, and legal-rights activists in the U.S. and around the world reacted with horror.

Court challenges were filed from 2003 onward, demanding full legal rights for Guantanamo inmates, plus the right to be tried in a civilian court or its military equivalent, a court martial.

These allow full legal rights for defendants to see and challenge prosecution evidence, to call any and all witnesses and to appeal to higher courts.

Courts in the United States began to rule on the challenges, and many found that detainees were, indeed, entitled to broader access to justice and, at the very least, to learn the reason for their detention.

In mid- to late 2004, the dossiers of inmates at the naval base in Cuba were put before so-called combatant status review panels, which consisted of military officers who determined whether the inmates were actually captured foreign soldiers. Almost all who faced this process were declared "unlawful enemy combatants," and Washington said that severely limited their Geneva Convention rights.

Lawyers, activists fight back

The legal battle continued and .since then, a confusing labyrinth of lawsuits, court decisions, U.S. policy changes and political posturing has shrouded the fate of the long-term Guantanamo captives in uncertainty.

The U.S. had said under George W. Bush that it wanted to release many of the detainees without trial if it could find a country to accept them. Washington intends to try about 80 inmates but has charged only 21 with crimes.

Of these, two have been convicted:

David Hicks, an Australian who pleaded guilty to a reduced terror charge in 2007 and was sent home to serve a few months remaining in his sentence.

Salim Hamdan, a Yemeni who was found guilty by a military trial of providing material support to terrorism but innocent of a more serious charge, conspiracy to commit terror crimes. His lawyers plan to appeal.

Toronto-raised Khadr and alleged Sept.11 mastermind Khaled Sheikh Mohammed are among those who've been charged. So have several other so-called high profile detainees who prosecutors allege planned attacks on the U.S. and other nations.

In this courtroom sketch, approved by the U.S. military, Omar Khadr is shown during his hearing at Guantanamo Bay in May 2008. ((Janet Hamlin/CBC))

The military commissions used at Guantanamo are controversial. They were first used in the years after the Second World War to prosecute suspected Japanese and German war criminals. Evidence obtained by torture was permissible, and there was no right of appeal.

Dusting off a six-decades-old process to try terror suspects provoked outrage from legal and human rights activists. In 2006, the U.S. Supreme Court agreed. In a split decision, the high court ruled that military commissions were illegal and put the country in violation of the Geneva Conventions.

That ruling was a response to cases filed by Hamdan and others, challenging their detention and demanding the right to seek redress from U.S. civilian courts.

On Jan. 21, 2009, a 120-day adjournment was granted for all war-crimes cases before the military commission, including that of Khadr. Calls were renewed for the Canadian government to ensure Khadr, 22, the last Western prisoner at the base, is brought home.

Khadr is accused of killing an American soldier in Afghanistan in July 2002, when he was 15.

Congress OKs commissions

A then Republican-controlled U.S. Congress responded to the Supreme Court ruling by passing the Military Commissions Act. It took the court's concerns into account, allowing avenues of appeal and explicitly prohibiting evidence obtained through torture.

Defendants still had huge limits on their legal rights. These included:

Defendants and their lawyers can be denied access to evidence against them if revealing it would arguably put national security at risk.

Evidence obtained through coercive techniques that stop short of torture but wouldn't be recognized in civilian or U.S. military courts is permissible.

The presiding judge of the court has wide discretionary powers over evidence, testimony and other matters.

Proceedings can be delayed or stopped at any time at the discretion of the presiding judge with no reason given.

Proceedings can be closed to the public, defence lawyers and the defendant at any time.

There is no guarantee of release even on acquittal because defendants are already labelled "unlawful enemy combatants" by U.S. military panels.

Charges against Hamdan and Khadr dismissed as a result of the 2006 Supreme Court verdict were reinstated in 2007, and the U.S. confirmed its intention to speed up the military commissions process.

Controversy continued. Several military prosecutors resigned before their cases came to trial. Judges were removed when they issued rulings that reflected badly on the Pentagon. Lawyers for Hamdan, Khadr and others filed fresh challenges to the system and demanded their clients be granted the right of habeas corpus — one of the most basic pillars of the justice system common to the U.S., Canada, Britain and other countries.

In June 2008, another U.S. Supreme Court decision found in favour of the Guantanamo detainees, giving them the right to use the civilian legal system to press their demands to be charged or released — the definition of habeas corpus.

That came too late for Salim Hamdan, who was found guilty in August 2008 of one of two terrorism charges against him.

Detainees at the U.S. base will have to wait to see what legal twists and turns await them. There is talk that the cases will be tried on U.S. soil, but that depends on Obama and what direction his administration takes.