From Scientific American:
If people told you that they wanted to have a perfectly good leg amputated, or that they have three arms, when they clearly do not, you would probably think that they are mentally disturbed. Psychiatrists, too, long considered such conditions to be psychological in origin. Voluntary amputation, for example, was regarded as a fetish, perhaps arising because an amputee's stump resembles a phallus, whereas imaginary extra limbs were likely to be dismissed as the products of delusions or hallucinations.
These bizarre conditions—named body integrity and identity disorder (BIID) and supernumerary phantom limb, respectively—are now believed to have a neurological basis, and a growing body of literature suggests that such body awareness disorders occur as a result of abnormal activity in the right superior parietal lobule (SPL). This brain region integrates different types of sensory information and processes it further to generate an internal model of the body. Two forthcoming studies provide strong evidence that the gross distortions of body image experienced in both conditions do indeed occur as a result of SPL dysfunction.
More here.