KABUL - A last-minute agreement has been reached on how to handle the transfer of U.S. detention facilities in Afghanistan to the Kabul government, Afghan and Western officials said Friday.
The issue has threatened to derail a long-term partnership between the two countries. They are in negotiations to formalize a role for U.S. forces after NATO's scheduled transfer of security responsibility to the Afghan government by the end of 2014.
Afghan President Hamid Karzai set Friday as the deadline for handover of control of the Parwan detention facility, a U.S.-run prison that holds about 3,000 detainees, most of them Afghan citizens.
Earlier, Afghan officials indicated some in the Afghan government were ready to accept an American proposal to delay the transfer for six months in the framework of an agreement, but it was not clear if Karzai would go along with that.
Parwan is the largest of the facilities, located next to the sprawling Bagram military base near Kabul, the capital.
The U.S. previously handed over responsibility for a few hundred detainees there but said the Afghan government was not ready to take over running the full detention centre.
Afghan Defence Minister Gen. Abdul Rahim Wardak and U.S. Gen. John Allen, the commander of NATO and U.S. forces in Afghanistan, will sign a memorandum later Friday, the Afghan Foreign Ministry said in a statement.
The ministry did not say what the memorandum covered, but a Western official confirmed that it was about the transfer of detention facilities. The official said the exact wording of the agreement was still being discussed, but the major issues have been decided.
The official declined to give other details and spoke anonymously because the document was still being finalized.
An Afghan official confirmed separately that the agreement was about detention issues but declined to give more details. The official spoke anonymously to discuss the deal before it was made public.
U.S. and Afghan officials have said that they want the a strategic partnership agreement signed by the time a NATO summit convenes Chicago in May, but talks have stalled in recent months, partly because of the disagreement over the detention facilities.
Several other key issues remain unresolved.
Karzai has demanded an end to night raids in Afghan villages by international forces. The raids target insurgents, but Karzai has said civilians are too often rounded up or killed when raids turn violent. Karzai insists that if there are night raids, Afghan troops should conduct them alone.
Afghan and U.S. officials said previously that both the detention and night raid issues might be handled separately from the partnership agreement, in order to push a deal through.
President Barack Obama and Karzai discussed the stalled security pact talks in a video conference on Thursday, the White House said.
White House press secretary Jay Carney said the two leaders noted progress toward completing an agreement "that reinforces Afghan sovereignty while addressing the practical requirements of transition."
The U.S.-Afghan pact is expected to provide for several thousand U.S. troops to stay and train Afghan forces and help with counterterrorism operations. It would outline the legal status of those forces, their operating rules and where they would be based.
The agreement is also seen as a means of assuring the Afghan people that the U.S. does not plan to abandon their country, even as it withdraws its combat forces.
U.S. Embassy spokesman Gavin Sundwall declined to comment on Friday's agreement.
Relations between the U.S. and Afghanistan have become more tense in recent weeks following the burning of Qurans and other religious materials at the Bagram base, sparking riots and attacks that killed some 30 people.
The U.S. has apologized and said the Qurans came from the detention centre and were taken out because they had extremist messages written in them, but that they should not have been sent to be burned.
Karzai said soon after the Qur'an burning became public that these types of incidents would not occur if the Afghans were in charge of the detention facility.
The debate about the agreement has also caused rifts within Karzai's inner circle. Afghan officials have said that National Security Adviser Rangin Dadfar Spanta tried to resign more than two months ago after disagreements erupted between him and Karzai over the strategic partnership document. Spanta argued for more flexibility from his government.