Mukhannathun (مخنثون "effeminate ones", "men who resemble women", singular mukhannath) is classical Arabic for men who have been castrated, perhaps poorly distinguished from eunuchs. There has been significant mention of "mukhannathun" in ahadith and by scholars of Islam. Outside of religious texts, they are strongly associated with music and entertainment.
Khanith is a vernacular Arabic term used in Oman and the Arabian Peninsula to denote the gender role ascribed to males who function sexually, and in some ways socially, as women. The word is closely related to the word mukhannath.
Mentions of Mukhannathun in the Hadith and Sunnah
A hadith is Sunan Abu Dawud 41, 4910:
A mukhannath who had dyed his hands and feet with henna was brought to the Prophet. He asked: What is the matter with this man? He was told: Apostle of Allah! he affects women's get-up. So he ordered regarding him and he was banished to an-Naqi'. The people said: Apostle of Allah! should we not kill him? He said: I have been prohibited from killing people who pray. AbuUsamah said: Naqi' is a region near Medina and not al-Baqi.
Another reference occurs in Sunan Abu Dawud 32, 4095, in which Aisha says:
A mukhannath used to enter upon the wives of Prophet. They (the people) counted him among those who were free of physical needs. One day the Prophet entered upon us when he was with one of his wives, and was describing the qualities of a woman, saying: When she comes forward, she comes forward with four (folds of her stomach), and when she goes backward, she goes backward with eight (folds of her stomach). The Prophet said: Do I not see that this one knows what here lies. Then they (the wives) observed veil from him.
According to the scholar and hadith collector al-Nawawi:
A mukhannath is the one ("male") who carries in his movements, in his appearance and in his language the characteristics of a woman. There are two types; the first is the one in whom these characteristics are innate, he did not put them on by himself, and therein is no guilt, no blame and no shame, as long as he does not perform any (illicit) act or exploit it for money (prostitution etc.). The second type acts like a woman out of immoral purposes and he is the sinner and blameworthy.
The mukhannath is not only the one who is known to be promiscuous. The mukhannath is (also?) the one who looks so much like a woman physically that he resembles women in his softness, speech, appearance, accent and thinking. If he is like this, he would have no desire for women and he would not notice anything about them. This is one of those who have no interest in women who were permitted to enter upon women.
In the current era, scholars in Iran and Egypt have issued fatwas supporting the right for those who fit the description of mukhannathun to have sex reassignment surgery. In Pakistan, members of the transgender community live as hijras, and are officially recognized as a third-gender being neither male nor female.
The mukhannathun as a group do not fit neatly into any one of the prevailing categories of gender or sexuality used by modern LGBTQUIA+ communities. While they were probably not cisgender or heterosexual, it cannot be said that they were simply either homosexual males, or transgender women. Although they portray a variety of gender and sexual identities, it seems that the there is too much variety between one mukhannath to the next to determine a specific label for their gender or sexual identity.
In The Effeminates of Early Medina, Everett K. Rowson describes the very same mukhannathun who appear in the Hadith, and who were companions of the prophet Muhammad. Rowson describes several other mukhannathun who were contemporary with Muhammad, in particular Ṭuways and al-Dalal. Ṭuways was a talented musician and singer who lived to the age of 82. Ṭuways is known to have married and fathered children. From what is written, al-Dalal clearly preferred men. Specifically it is written that "Al-Dalal enjoyed women's social company any sexual demand made of her was in vain". Al-Dalal is said to have had a sexual encounter with a woman on her wedding night. Al-Dalal then later that same night had sexual relations with the groom. Similar stories exist about the other mukhannathun of Medina.
According to Muhsin Hendricks:
Muhammad did deal with a group of effeminate men in Medina called "Mukhannathun". However, while this group of Mukhannathun did possess qualities of modern gay men, it cannot be said that the Mukhannathun fully represent modern homosexual men, as they were involved in practices not common to contemporary homosexual men.
Some scholars say that, in the case of a mukhannath or intersex individual, if it is not known whether he is male or female, it is not permissible for him to get married; if it becomes clear that he is male, then marriage to him is valid, so long as you seek advice in such a case from a trustworthy doctor who specializes in hereditary matters and the like, in order to confirm his gender and the possibility of marrying him. 
At one point in time during the Umayyad Caliphate, a caliph, usually identified as Sulayman ibn Abd al-Malik, reportedly ordered that all Mukhannathun should be castrated. He had been angered by them in some way or other - the motive varies between the different accounts. According to Rowson:
Several sources name some or all of the victims (besides al-Dalal, who is almost always included). A number of these also report a series of quips said to have been pronounced by them on the occasion. The fullest version of these statements is offered by Hamza, whose list is as follows:
- Ṭuways: "This is simply a circumcision which we must undergo again."
- al-Dalal: "Or rather the Greater Circumcision!"
- Nasim al-Sahar: "With castration I have become a mukhannath in truth!"
- Nawmat al-Duha: "Or rather we have become women in truth!"
- Bard al-Puad: "We have been spared the trouble of carrying around a spout for urine."
- Zill al-Shajar: "What would we do with an unused weapon anyway?"
The last two statements imply that what the mukhannathiin underwent was jibdb, the more drastic form of castration in which the penis was truncated. They serve to stress the mukhannathiin's lack of sexual interest in women, while the two preceding statements identify the essential psychological motivation behind takhannuth as gender identification with women. The flippancy of tone in these quips is of course characteristic of the mukhannath persona, and also points to the singular inappropriateness of the punishment, despite its savagery; significantly, there is no positive reference to sexual orientation, as opposed to gender identity.
Interestingly, Rowson goes on to write about this story:
A third account, dependent on the "tāhif" version of the castration story, reports that the caliph Sulayman was grieved by the accidental castration of the charming al-Dalal, and had him secretly brought to his court. When the caliph asked him how he was, al-Dalal replied, "Now that you've truncated (jababta) me in front, do you want to truncate me in back?" Sulayman laughed, and ordered him to sing. Unable to decide whether he was more charmed by his wit or his singing, the caliph kept him, with him a month, rewarded him richly, and sent him back to the Hijaz.
- Rowson, Everett K. (October 1991). "The Effeminates of Early Medina" (PDF). Journal of the American Oriental Society. American Oriental Society. 111 (4): 671–693. doi:10.2307/603399. JSTOR 603399.
- "General Behavior (Kitab al-Adab)". www.usc.edu. Center for Muslim-Jewish Engagement.
- "Partial Translation of Sunan Abu-Dawud, Book 32: Clothing (Kitab al-Libas)". www.usc.edu. Center for Muslim-Jewish Engagement.
- Al Muqni, Matan. al Sharh al Kabeer. pp. 347–348.
- Bolich, G. G. (2009). Crossdressing in Context, Vol. 4 Transgender & Religion. Lulu.com. ISBN 978-0-615-25356-5., pp 271-272
- Bolich, G. G. (2009). Crossdressing in Context, Vol. 4 Transgender & Religion. Lulu.com. ISBN 978-0-615-25356-5., page 275
- Pasquesoone, Valentine. "7 Countries Giving Transgender People Fundamental Rights the U.S. Still Won't". Mic.
- Comstock, Gary David; Henking, Susan E. (1997). Que(e)rying Religion: A Critical Anthology. A&C Black. ISBN 978-0-8264-0924-9., page 69
- Hendricks, Muhsin (July 2006). Islam and Homosexuality (PDF). ILGA's preconference on religions: ILGA. Retrieved 2007-06-22.
- "Ruling on marrying a man who is intersex or impotent, and the difference between them". Muhammad Saalih al-Munajjid. islamqa.info. Retrieved 24 July 2015.
- Hadith on this matter, USC-MSA compendium of Muslim Text: Partial Translation of Sunan Abu-Dawud, Book 32:Clothing (Kitab Al-Libas), Number 4095
- Hadith on this matter, USC-MSA compendium of Muslim Text: Partial Translation of Sunan Abu-Dawud, Book 41:General Behavior (Kitab Al-Adab), Number 4910