Reference: al-Fataawa al-Muta’alliqah bit-Tibb wa Ahkaam al-Mardhaa – Pages 303
Question: Is the one who has both male and female [sexual] organs to be treated as a female, bearing in mind his affair has not yet become clear [as to whether he is male or female]? And are all the rulings which are specific to a woman applicable to him [also]?
Response: Regarding such a person, some explanation is required.
Before attaining puberty there is [some] doubt; Is he [to be considered] a male or female because he has two [sexual] organs, a female organ and a male organ. However, in most cases after attaining puberty his masculinity or femininity becomes apparent. So, if there appears [upon him] that which indicates he is a woman, such as the appearance of both his breasts, or there appears upon him that which distinguishes him from the men such as menses, or urinating from the female organ, then [in this case] he is to be regarded as a woman and [as such] his male organ is to be surgically removed with care.
And if there appears [upon him] that which indicates he is a man, such as the growing of the beard and urinating from the male organ and other than that which the doctors are aware of, then he is to be regarded as a man.
And before [all this] he is to remain [in a state of ambiguity] until his matter becomes apparent; So he is not to be married off until it is apparent he is [clearly] a man or a woman. And this occurs after attaining puberty as the scholars have stated.