WASHINGTON - A U.S. judge has ordered a detainee at Guantanamo Bay to be released, saying the man was a captive, not a follower, of the Taliban.

U.S. District Court Judge Richard Leon disagreed with the government's claims against Abd Al Rahim Abdul Rassak. Leon said the Syrian man had spent 18 months in a Taliban prison after being tortured by al-Qaida.

Prosecutors had argued that Rassak had a pre-existing relationship with al-Qaida that was still in effect even after it had abused and imprisoned him.

In a written ruling Monday, Leon criticized U.S. officials for taking what he called `a position that defies common sense.' He ordered the government to take all diplomatic steps necessary to release Rassak, who now goes by the name Janko.