Afghan officials are set to take over responsibility for the U.S.-run detention facility at Bagram Air Base.
Afghanistan's Defense Ministry announced that a transfer agreement was signed Saturday.
The site, near Kabul, has been used to hold detainees captured during the U.S. and NATO-led offensive against the Taliban beginning in 2001.
A new facility was opened in November of last year, and was designed to provide better living conditions for the inmates than the previous jail.
Prisoner abuse was reported taking place at Bagram, including beatings and lengthy detentions without charge.
Human rights groups have long criticized the facility, complaining that detainees are not given access to lawyers.
The U.S. Defense Department set up a system last year to allow prisoners to challenge their detention through special representatives, not lawyers.
About 700 detainees are being held at Bagram.