I am in dire need of help. I have a friend who has been going through a gender identity disorder for a very long time. We used to make fun of her when she dressed up as a boy and when she had facial and bodily hair quite like a boys. Then we went to study in different institutes. Now just recently I met her in a hospital because she is suffering from a severe depression. She says she feels trapped in her body and she has never felt like a girl. She made all the hormone tests and the results showed that there are too many male hormones in her body and this condition according to the doctor developed in her brain and body at the time when she was in her mother's womb. The treatment as per the doctors is either one of the following. The first treatment being her taking the hormone therapy for the rest of her life and not being able to conceive if she gets married and there will be some side effects, all this is just so that her body can look like a female's body. Or she undergoes the gender change surgery and takes male hormones for maybe a year or two and then without any side effects live her life normally as a boy with the exception that she won’t be able to become a father and she will also attain mental peace. She is in the state of disturbance and extreme pain because she has hormonal imbalance and it is not normal and she requires a treatment as soon as possible. My question is under such conditions is it allowed in Islam to undergo the sex change surgery? What is the ruling in such exceptional cases? Please help my friend because she wants the surgery but she doesn't know if it is allowed or not. I will be waiting for your reply. I hope you will take out some time and answer back as soon as possible.