President Hamid Karzai and President Bush agreed in May 2005 that the Afghan detainees would be returned to Afghanistan once facilities run by Afghans were prepared and personnel trained to handle them .