The agreement also means that despite his long incarceration, Yaser Esam Hamdi will not face any criminal charges in the United States.
Hamdi, born in Baton Rouge, La., and raised in Saudi Arabia, will be flown by the Defense Department to Saudi Arabia as soon as transportation can be arranged. He was being held in a Navy brig in Charleston, S.C. He holds citizenship in Saudi Arabia.
"This is a direct result of the Supreme Court's ruling in June that required the government to provide Hamdi with certain constitutional rights that he had not been given by his military guards," says CBS News Legal Analyst Andrew Cohen.
"And it is a concession by the government that Hamdi wasn't as dangerous as he had been made out to be."
Hamdi's lawyer, federal public defender Frank Dunham Jr., said in a statement that he was "gratified at the prospect that Mr. Hamdi's return to Saudi Arabia and his family is now only days away."
The agreement calls for Hamdi to renounce his U.S. citizenship and adhere to restrictions barring travel to certain countries. Other details were not immediately available.
Justice Department spokesman Mark Corallo said the restrictions are meant to ensure that Hamdi cannot again take up arms against the United States or its allies. Corallo said Hamdi's value as a detainee for intelligence purposes had been exhausted, leading to the decision to release him.
"As we have repeatedly stated, the United States has no interest in detaining enemy combatants beyond the point that they pose a threat to the U.S. and our allies," Corallo said.
Saudi officials have said Hamdi faces no charges in the kingdom.
Hamdi was captured on a battlefield in Afghanistan where he was fighting alongside the Taliban in late 2001. He was held for three months at the U.S. Navy base at Guantanamo Bay before being transferred to a Navy brig in the United States when officials realized he was a U.S. citizen.
He had contested his status as an enemy combatant, and the Supreme Court ruled in June that Hamdi and others like him could not be held indefinitely without seeing a lawyer and getting a chance to contest his incarceration in court.
The disposition of the Hamdi case leaves the Bush administration holding one U.S. citizen as an enemy combatant in the war on terror: former Chicago gang member Jose Padilla. Padilla is suspected of plotting with other al Qaeda operatives to launch attacks inside the United States, including a plan to fill apartments in several cities with natural gas and detonate them.