Now, as Congress considers whether to grant trials and transfers to most detainees, time may be running out on the law that allows the U.S. to hold them.
The 2001 law is known as the Authorization for the Use of Military Force, or AUMF. It allowed the U.S. military to invade Afghanistan to pursue, detain and punish extremists linked to the attacks of Sept. 11, 2001. The law has been used to justify attacks on militants in Pakistan, Yemen, Somalia and elsewhere.
Will it remain valid if U.S. combat troops withdraw from Afghanistan at the end of 2014 — whether thousands stay as trainers or if the U.S. pulls out entirely? That's an open legal question that, officials and experts say, must be resolved over the next year.
"The jury is still out on when the AUMF might expire," said Army Lt. Col Todd Breasseale, a Pentagon spokesman. "Many argue that's not set."
If U.S. troops withdraw, "it certainly increases the pressure, as some administration officials have argued, to decide whether the AUMF should remain in effect as is, or if a new version is necessary," Breasseale said in a statement.
In 2009, on the second day of his presidency, Obama ordered the terrorist detention center at Guantanamo Bay, Cuba, to be closed within one year. Obama long has derided the facility, where critics say detainees have been abused, interrogated and held illegally, as a blow to American values and credibility worldwide.
Opponents in Congress refuse to let the detainees come to the U.S. for trial, citing security risks to Americans. Lawmakers have blocked the transfer and resettlement of most of the remaining detainees to other nations, fearing they will return to terrorist havens upon their release. Nearly 30 percent of Guantanamo detainees who have been released have since resumed the fight.
Today, 164 detainees are held at Guantanamo, down from a peak of about 660 a decade ago. Most were tried, transferred or cleared for release under President George W. Bush. Seventy-eight have left since Obama took office.
The sprawling camp of barbed wire and hardened cell blocks costs U.S. taxpayers about $454 million each year; that comes to about $2.7 million per detainee.
The facility shows no signs of shutting down beyond a temporary budget freeze on the detainees' library, where well-worn copies of the Quran, the "Hunger Games" series and Obama's book, "The Audacity of Hope," are among the 6,000 titles available for reading.
New housing is being built for some of the estimated 5,500 U.S. troops and contractors at the Navy base. More than one-third of them work for the detention camp. Medical staff openly discuss how they will care for aging detainees in coming years.
The Republican-led U.S. House has written legislation that requires the Pentagon to give Congress an annual plan for Guantanamo until the youngest detainee, now in his late 20s, turns 66, meaning the detention camp could remain open for nearly 40 more years.
Early this year, as many as 100 detainees began a hunger strike to protest their uncertain fate. Guantanamo medical officials said last week that 13 detainees were so underweight that they must be force-fed if they refuse to eat, although some voluntarily accept food and nutrition drinks on any given day.
At least some detainees — Guantanamo officials won't say how many — are treated regularly for mental health issues. Others lash out at camp personnel on a near-daily basis, biting and hitting medical staff and throwing feces and other bodily fluids at military guards. Many of those guards are in their 20s and suffering from post-traumatic stress from working 12-hour shifts with openly aggressive inmates.