Just release them. Since the US was the country which arrested them in the first place, interrupted their lives and kept them for 11 years without a trial, at least the US could grant them residence permit. Sure, there might be a terrorist or 10 among the 500 detainees left but no real court would ever be able to convict them after a decade of torture and other human rights abuses. Also, since the US already has state-of-the-art surveillance in place they would be able to keep an eye on these guys in the future ;-)