Talks with the Taliban are seen as key to bringing some level of calm to Afghanistan, allowing U.S. troops to come home without the country descending into further chaos. But months of efforts to cobble together talks have failed.
Afghan President Hamid Karzai initially opposed sending the prisoners to Qatar instead of home to Afghanistan. But his government sent a delegation to Guantanamo Bay last week to visit the prisoners, a possible sign of Karzai's consent to the arrangement.
The five prisoners agreed to the transfer as long as they would be reunited with their families in Qatar, said two senior Afghan officials.
A former U.S. official familiar with the negotiations over the prisoners confirmed the Afghan delegation's visit.
All three officials spoke on condition of anonymity because of the sensitivity of the issue.
The delegation could not have visited the prison without U.S. approval, but a spokeswoman for the White House national security council declined to comment.
The prisoners proposed for transfer include some of the detainees brought to Guantanamo during the initial days and weeks of the U.S. invasion that toppled the Taliban government in Afghanistan in 2001. At least one has been accused in the massacre of thousands of Shiite Muslims in Afghanistan, according to U.S. and other assessments, but none is accused of directly killing Americans.
The Obama administration does not want to send the prisoners to Afghanistan, in part for fear they might be released. The men are considered "enemy combatants" who were, at least until recently, considered too dangerous to release.
They would likely be held in Qatar under conditions that are less secure and less restrictive than at Guantanamo.
Afghan officials said previously that they discussed with the United States a plan to give Afghanistan a form of legal custody over the men if they are released as a way to satisfy their earlier objection to sending the prisoners to a third country. It's unclear whether that plan came under discussion during the recent visit or if anything was made final.