A US citizen held prisoner since his capture by US forces in Afghanistan in 2001 has been sent to Saudi Arabia as part of a deal securing his release.
Hamdi was born in the US and brought up in Saudi Arabia
Yasser Essam Hamdi arrived in the Saudi capital Riyadh on Monday on a US military plane.
The US Justice Department agreed to free him on condition that he gave up his US citizenship.
The Supreme Court ruled in July that Mr Hamdi had a right to challenge his detention without trial in a US court.
Mr Hamdi, who is of Saudi descent, was allegedly captured while fighting US forces alongside the Taleban militia.
Designated an "enemy combatant" by the Bush administration, he was never charged with an offence and has spent more than two years in prisons run by the US military.
A Saudi interior ministry spokesman said: "His parents were there to receive him. The minute he
arrived, he said he had given up his US nationality. He will be treated according to laws in force in the kingdom."
Frank Dunham, Mr Hamdi's lawyer in the US state of
Virginia, said he was frustrated that the legal battle over his client's case took two-and-a-half years, but pleased with the final outcome.
"It feels wonderful because we had fought to get the
victory in the Supreme Court, but it really didn't mean
anything until we got Mr Hamdi released."
Born in the southern state of Louisiana in 1980
to Saudi parents and raised in Saudi Arabia, Mr Hamdi contends that he never fought against the US and that he was trying to get out of Afghanistan when he was captured.
He was initially shipped to the detention facility at Guantanamo Bay, Cuba, but was transferred to jails in Virginia and South Carolina after it became known that he was a US citizen.
The judge who delivered the Supreme Court ruling enabling him to challenge his detention said a state of war was "not a blank cheque for the president when it comes to the rights of the nation's citizens".
The US government signed an agreement for Mr Hamdi's release with his lawyer.
Besides surrendering his American citizenship, Mr Hamdi was required to renounce terrorism, agree to live in Saudi
Arabia for five years and not sue the US government over his captivity.
He is also barred from visiting Afghanistan, Iraq, Israel, Pakistan, Syria, the West Bank and the Gaza Strip.
The release agreement requires Hamdi to notify Saudi
officials if he becomes aware of "any planned or executed acts of terrorism".
Justice Department spokesman Mark Corallo said the US "has no interest in detaining enemy combatants beyond the point that they pose a threat to the US and our allies".
US authorities are holding at least one other US citizen without trial as an "enemy combatant" - the former Chicago gang member Jose Padilla, accused of planning terror attacks using radioactive materials.