The spatial unity of self and body is challenged by various philosophical considerations and several phenomena, perhaps most notoriously the "out-of-body experience" (OBE) during which one's visual perspective and one's self are experienced to have departed from their habitual position within one's body. Although researchers started examining isolated aspects of the self, the neurocognitive processes of OBEs have not been investigated experimentally to further our understanding of the self. With the use of evoked potential mapping, we show the selective activation of the temporoparietal junction (TPJ) at 330-400 ms after stimulus onset when healthy volunteers imagined themselves in the position and visual perspective that generally are reported by people experiencing spontaneous OBEs. Interference with the TPJ by transcranial magnetic stimulation (TMS) at this time impaired mental transformation of one's own body in healthy volunteers relative to TMS over a control site. No such TMS effect was observed for imagined spatial transformations of external objects, suggesting the selective implication of the TPJ in mental imagery of one's own body. Finally, in an epileptic patient with OBEs originating from the TPJ, we show partial activation of the seizure focus during mental transformations of her body and visual perspective mimicking her OBE perceptions. These results suggest that the TPJ is a crucial structure for the conscious experience of the normal self, mediating spatial unity of self and body, and also suggest that impaired processing at the TPJ may lead to pathological selves such as OBEs.