Afghanistan has taken control from Nato of the controversial Bagram airbase prison set up by US troops but is yet to iron out disagreements over the fate of hundreds of inmates.
A move is hailed by Kabul as a victory for sovereignty, but analysts say it is largely symbolic as Nato prepares to leave Afghanistan after more than a decade fighting the Taliban, leaving Afghan security personnel in charge in late 2014.
Major questions remain over the immediate and long-term fate of more than 3,100 inmates, which include Taliban fighters and terror suspects, held at Bagram, sometimes referred to as the Guantanamo Bay of Afghanistan.
About 50 foreigners are not covered by the agreement, and hundreds of other Afghans arrested since the transfer deal was signed on March 9 are also being held at what is formally known as the Parwan Detention Facility, outside the Bagram US airbase.
Afghan officials presided over a small handover ceremony, which was marked by low attendance by US and Nato officers.
"I'm happy that today we are witnessing a glorious ceremony that marks the handing over of responsibilities of Afghan prisoners to Afghans themselves," acting defence minister Enayatullah Nazari told the ceremony.
Afghan military police commander Safiullah Safi said 3,182 prisoners had been formally handed over to Afghan military police, following a six-month transition.
Karzai demanded authority over the prison as conditional to addressing long-term Afghan-US relations and possible legal immunity for US troops, the key to troops remaining after 2014. But the Memorandum of Understanding (MoU) governing the handover is not legally binding.
Karzai's spokesman, Aimal Faizi, says there are disagreements over the interpretation of the deal and that more than 600 people detained since March 9 have not yet been transferred to Afghan custody.
Nato spokesman Jamie Graybeal says 99 per cent of detainees held before March 9 are under Afghan authority and that the transfer of the rest has been put on hold, pending concerns about the intentions of the government to fulfil the terms of the MoU.
Graybeal said the US retained the authority to capture and detain suspects, but intended to continue to transfer Afghan detainees to Afghans.
Foreign detainees will remain under US control and American advisers will also stay at the prison until March 9 next year.
A former mujahideen commander who was arrested in 2003 and held at both Bagram and Guantanamo Bay in Cuba said the Americans treated their prisoners better than the Afghans. Ghaleb, 55, declined to give his second time but described himself as an influential elder in his hometown in the eastern province of Nangarhar.
"I have heard the same from other prisoners who were tortured by government people. I have seen many prisoners who say they were happier to have been kept in jails under the command of Americans," he said.