The U.S. military says 27 detainees who died in U.S. custody in Afghanistan and Iraq between 2002 and 2004 were the victims of homicide or suspected homicide .