This article investigates the attribution of mental state (AMS) to an anthropomorphic robot by humans in a strategic interaction. We conducted an experiment in which human subjects are paired with either a human or an anthropomorphic robot to play an iterated Prisoner's Dilemma game, and we tested whether AMS is dependent on the robot "consistency," that is, the correspondence between the robot's verbal reaction and its behavior after a nonoptimal social outcome of the game is obtained. We find that human partners are attributed a higher mental state level than robotic partners, regardless of the partner's consistency between words and actions. Conversely, the level of AMS assigned to the robot is significantly higher when the robot is consistent in its words and actions. This finding is robust to the inclusion of psychological factors such as risk attitude and trust, and it holds regardless of subjects' initial beliefs about the adaptability of the robot. Finally, we find that when the robot apologizes for its behavior and defects in the following stage, the epistemic component of the AMS significantly increases.