Officials in Afghanistan say the United States has released 17 Afghan detainees from military custody at Guantanamo Bay in Cuba .