Anas b. Malik reported:
Abdullah b Zubair said: A man accused of sodomy with a male was brought before the The Messenger of Allah (ﷺ). And he said to the Prophet: “I could not tell if the anus was that of a man or a woman’s. Therefore I do confess, but plead ignorance”. And because the punishment of sodomy depends on the sex of the passive partner, the Prophet called for the male who had been sodomized to come before him. The passive one came and we saw that it was a boy barely of adulthood. His hair was like a man’s in texture and feel, but it flowed beautifully below his shoulders. His behind was shapely and cute, and in darker lighting I would also have struggled to determine his sex. So The Messenger of Allah (ﷺ) derobed the young man and bent him over so that he could see what the dominant partner had seen. And I saw that his bottom was like a baby’s; smooth, unstained, and reminiscent of better times. And the prophet said “If not for his male genitals, I would say he was a woman”. And the dominant partner was given fifty lashes and the submissive partner made up to be a woman and incorporated into the prophet’s harem.