The United States will maintain the power to veto the release of detainees at the facility, according to The Associated Press.
The detainee transfer removes one of the roadbloacks to a strategic partnership between the United States and Afghanistan. Karzai had demanded that the United States relinquish control of the detention facility and end night raids in Afghanistan.
U.S. Afghanistan commander Gen. John Allen and Afghan Defense Minister Abdul Rahim Wardak signed the detention agreement on Friday.
“It is yet another example of the progress of transition, and our efforts to ensure that Afghanistan can never again be a safe haven for terrorists," Allen said in a statement.
Eventually, some 3,000 detainees would be transferred under Afghan control, and the first 500 detainees are expected to be transferred in the next 45 days, The Associated Press reported.
The United States will continue to provide support and guidance to the Afghans at the facility for 12 months under the agreement.