A Mexican army officer and seven soldiers were detained Thursday in connection with the deaths of 22 gang suspects, the defense ministry said.