The Justice Department and lawyers for 38-year-old Aymen Saeed Batarfi have agreed to put his court case on hold while the government looks for a country to take him, according to papers filed in federal court in Washington.
According to U.S. officials, Batarfi, a doctor from Yemen, spoke to Osama bin Laden during the fighting in 2001 at Tora Bora.
As part of the deal struck with government lawyers, Batarfi can restart his lawsuit if he is not delivered to a country acceptable to him within 30 days, according to the terms of the deal that still must be reviewed by a judge.
The U.S. will now work to transfer Batarfi "to an appropriate destination country in a manner that is consistent with the national security and foreign policy interests of the United States and the interests of justice," said Justice Department spokesman Dean Boyd.
Batarfi's lawyer William J. Murphy said he was "very pleased" with the decision.
"It's been our position throughout that medical doctors are not to be detained as combatants," said Murphy, who declined to say to which countries Batarfi would like to be sent.
Batarfi was first held by U.S. forces at Bagram Air Base in Afghanistan in late 2001 and transferred to the U.S. naval station at Guantanamo Bay, Cuba, in April 2002.
U.S. officials have worried about sending detainees back to Yemen because of instability there.
His lawyers say when Batarfi was captured he was on a humanitarian aid mission and not assisting al Qaeda. U.S. authorities say he was helping treat al Qaeda fighters.
About 240 detainees are held at Guantanamo. President Barack Obama has ordered the detention facility be emptied within a year - dismantling one of the cornerstones of the Bush administration's anti-terror effort.
Batarfi's case led a federal judge earlier this year to accuse the Bush administration of hiding evidence.
U.S. District Judge Emmet Sullivan said in January that he was forced to delay ruling on whether to free Batarfi because as many as 10 documents of classified information were withheld from the court until recently.
At the time, the judge called the government's conduct unfair and disingenuous.
The issue of classified evidence is not unique to Batarfi. Much of the evidence in the cases of hundreds of detainees seeking release will likely never be made public.
In past hearings, lawyers had sparred over exactly what Batarfi was doing in Afghanistan when he was caught.
His lawyers say he was doing humanitarian work along the Afghanistan-Pakistan border when he was injured and swept up by Northern Alliance forces, which turned him over to the U.S.
However, Justice Department lawyers contend he was at one of al Qaeda's major battles, and not just as a charity worker.
Papers filed last year in the case charge Batarfi twice met bin Laden, the second time at the fierce battle at Tora Bora between U.S. forces and al Qaeda. Bin Laden allegedly asked the doctor to provide medical treatment to wounded fighters, and he agreed.