The Obama administration is considering repatriating most of the non-Afghan detainees held at the main American-run prison in Afghanistan. (David Guttenfelder/AP)

The Obama administration is considering the repatriation of most, if not all, of the non-Afghan detainees held at the main American-run prison in Afghanistan, an effort to oversee their transfer before U.S. officials relinquish control of the facility, according to administration officials.

The foreign prisoners, who number close to 50, were in some cases picked up on the battlefield in Afghanistan and in others detained in third countries and taken to the prison by the CIA, according to U.S. and foreign officials.

With the U.S. government planning to hand over control of the prison, American officials believe that Afghan authorities are unlikely to have any interest in either continuing to hold the foreigners or in putting them on trial. By beginning the repatriation process soon, officials believe they can negotiate transfers with the detainees’ home countries, arrange for post-transfer monitoring, and secure diplomatic assurances that detainees will not be abused when they return home.

U.S. officials said that deliberations about the detainees, being held near Bagram Air Base, have just begun and that no final decisions have been made. The officials spoke on condition of anonymity because of the sensitivity of the issue.

A small number of detainees may be deemed to pose a terrorist threat, requiring their continued detention or close supervision by their home country if released from the Afghan prison, officials said. Additionally, a number of them are Yemeni, complicating their possible repatriation. President Obama has suspended the transfer home of their fellow nationals from Guantanamo Bay, Cuba, because of concerns about the security situation in Yemen.

The largest single group of foreign detainees at the prison is Pakistani, and there are up to two dozen Arabs of various nationalities, according to administration and foreign officials.

Among the first detainees likely to be transferred home is Yunus Rahmatullah, a Pakistani national, whose release has been demanded by a British court. Rahmatullah, a suspected extremist, was picked up by troops with Britain’s elite Special Air Service in Iraq in 2004 and handed over to U.S. forces. The CIA subsequently flew him to Afghanistan without informing the British, according to press reports and court papers.

Attorneys for Rahmatullah, 29, argued in the British courts that the transfer violated a memorandum of understanding between the U.S. and British militaries, and was a grave violation of the Geneva Conventions because it involved the removal of a civilian from the war theater.

Last month, a British court granted a writ of habeas corpus and ordered the British government to get custody of Rahmatullah. The court noted that a 2010 Detainee Review Board hearing of military officers at Bagram cleared Rahmatullah for release.

The British Court of Appeal said that if the British foreign secretary and defense minister failed to secure Rahmatullah, it would “be moved to commit you to prison for your contempt in not obeying the said writ.” The court set a deadline of Feb. 14 for Rahmatullah’s release.

The British government has appealed the decision, but it has also asked the United States to arrange for Rahmatullah’s swift return to Pakistan, which would satisfy the court and his lawyers.

“It would make no sense for the Obama administration to ratify this Bush-era war crime,” said Cori Crider, legal director of Reprieve, a London-base human rights group that is representing Rahmatullah. “Under the Geneva Convention, Yunus Rahmatullah is Britain’s responsibility and should never have been sent to Bagram in the first place. The man is cleared, his family are waiting, and Pakistan is apparently happy to have him — it’s high time to send him home.”

Amanatullah Ali, another Pakistani who was picked up with Rahmatullah and also taken to Bagram, is seeking his release through the U.S. courts.

Seven Pakistani detainees taken to Bagram, including Rahmatullah, are also suing the Pakistani government either for its alleged role in their capture or for failing to secure their release.

Administration officials said they are willing to transfer Rahmatullah, but do not want the basis of such a move to be a foreign court ruling. They also said that any transfer home has been complicated by the deterioration in relations between the United States and Pakistan.

“We will do this on our timetable,” said one official.

The case nonetheless is another incentive to begin dealing with the non-Afghan population at the prison in Afghanistan, which is known as the Parwan detention center and which replaced the facility inside the nearby Bagram Air Base.

In early January, Afghan President Hamid Karzai called on the United States to turn Parwan over to his government. U.S. officials had said two years ago that they expected the prison would be turned over in early 2012.

While Karzai apparently regarded that as a hard deadline, U.S. officials said it was always contingent on Afghanistan’s “demonstrated capacity” to manage the facility.

The prison now holds approximately 2,600 prisoners, up from the 600 held in 2009.

The foreign detainees include two Yemenis and one Tunisian who attempted to secure their release by filing for writs of habeas corpus in the U.S. District Court in Washington in 2009. All three claimed they were captured outside Afghanistan, held at secret CIA prisons overseas, before being transferred to the detention center in Bagram.

Judge John D. Bates ruled that these non-Afghan prisoners had the right to pursue habeas cases; however, the federal court of appeals overturned that decision in 2010.

A U.S. official said the three men were among those who could be repatriated.