The ability to "mentalize," that is to understand and manipulate other people's behavior in terms of their mental states, is a major ingredient in successful social interactions. A rudimentary form of this ability may be seen in great apes, but in humans it is developed to a high level. Specific impairments of mentalizing in both developmental and acquired disorders suggest that this ability depends on a dedicated and circumscribed brain system. Functional imaging studies implicate medial prefrontal cortex and posterior superior temporal sulcus (STS) as components of this system. Clues to the specific function of these components in mentalizing come from single cell recording studies: STS is concerned with representing the actions of others through the detection of biological motion; medial prefrontal regions are concerned with explicit representation of states of the self. These observations suggest that the ability to mentalize has evolved from a system for representing actions.