Records of men who have sex with men in Japan date back to ancient times. Western scholars have identified these as evidence of homosexuality in Japan.
There were few laws restricting sexual behavior in Japan in the beginning of modern period. Anal sodomy was restricted by legal prohibition in 1872, but the provision was repealed only seven years later by the Penal Code of 1880 in accordance with the Napoleonic Code.
Historical practices identified by scholars as homosexual include shudō (衆道), wakashudō (若衆道) and nanshoku (男色).
Modern terms for homosexuals include dōseiaisha (同性愛者?, literally same-sex-love person), gei (ゲイ?, gay), homo (ホモ?), homosekusharu (ホモセクシャル?, homosexual), bian (ビアン?, shortened form of lesbian), rezubian (レズビアン?, lesbian) and rezu (レズ?, shortened form of lesbian).