One of the more surprising aspects of Japanese popular culture is the number of stories featuring characters of questionable gender, including boys pretending to be girls (joso or "traps") and girls pretending to be boys (danso or "reverse traps"). These characters have become a staple of anime and manga plots, and whenever there's a harem story with two "male" characters in an otherwise all-female setting, it's a given that one of them is secretly a girl pretending to be a boy. Japan's tradition of men performing as females goes back to the Edo Period with Kabuki plays in which male actors filled all parts, including the female roles (onnagata), which they do with great skill. Women got their revenge for being banned from the stage for two centuries with the founding of the Takarazuka Revue in 1913, which feature extravagant musical productions with all-female casts, including the most talented ladies playing handsome male roles like Rhett Butler, which is hot. It's common for doujin artists to create fan-derived "gender-bent" versions of their favorite characters, like Kyonko and Haruhiko, cross-gendered versions of Kyon and Haruhi, which naturally take on lives of their own in the new fan-created canon.
Gender-bent characters in anime.