U.S. District Judge Royce Lamberth issued a release order on Friday for Ibrahim Idris, a native of Sudan who has been held as an enemy combatant but not formally charged.
The decision came after the lawyers for the U.S. Department of Justice filed court papers on Wednesday indicating the government would no longer oppose his release. The filing did not specifically say why the government decided to drop its objection.
Idris' lawyers had repeatedly argued his illness was so severe he could not pose a security threat.
U.S. officials say Idris, who is in his 50s, was captured with al Qaeda fighters in 2001 by Pakistani forces while attempting to cross the Afghanistan-Pakistan border.
Shortly after he arrived in Guantanamo in 2002, a U.S. army psychiatrist diagnosed him as mentally ill and said Idris suffered from schizophrenia that made it difficult for him to work with his lawyers.