And when they found out he was a US citizen (about 6 months after capture), he was transferred to military jails in Virginia and South Carolina. He was in the system for a total of 3 years, and then in exchange for renouncing his US citizenship and agreeing to travel restrictions, etc, he was released and deported to Saudi Arabia where he grew up. Note the phrasing, he wasn't 'transferred' to Saudi Arabia, he was released, and given a plane ticket home.
Hamdi was in Guantanamo for less than two months (Feb. 11 to April 5, 2002) while his legal status was sorted out. Considering he was caught in Afghanistan fighting for the Taliban, I'd put that in the "a win for the republic" column.