In 1832 further laws were enacted criminalising certain sexual acts between two males; however, an LGBT subculture developed in Russia during that century, with many significant Russians being openly homosexual or bisexual.
In 1917, the Russian Revolution saw the overthrow of the Tsarist government, and the subsequent foundation of the Russian SFSR, the world's first socialist state, followed by the founding of the Soviet Union after the end of the civil war in 1922.
Author and critic Konstantin Leontiev was bisexual, and one of the most famous couples in the late-nineteenth-century Russian literary world were the lesbians Anna Yevreinova (a lawyer) and Maria Feodorova (an author).
Other notables included poet Alexei Apukhtin, Peter Tchaikovsky, conservative author and publisher Prince Vladimir Meshchersky, Sergei Diaghilev, who had an affair with his cousin Dmitry Filosofov and, after the breakup, with Vaslav Nijinsky.
In 1716, Tsar Peter the Great enacted a ban on male homosexuality in the armed forces.
The prohibition on sodomy was part of a larger reform movement designed to modernize Russia and efforts to extend a similar ban to the civilian population were rejected until 1835.
Leo Tolstoy's Resurrection introduces a Russian artist, convicted for having sex with his students but given a lenient sentence, and a Russian activist for gay rights as examples of the widespread corruption and immorality in Tsarist Russia.
These depictions of gay men and women in literature suggest that the government's selective tolerance of homosexuality was not widely expressed among the Russian people and that it was also divorced from any endorsement of LGBT rights.
His homosexual relationships were widely famous in Moscow.
Anarchist Alexander Berkman softened his prejudice against homosexuality through his relationship with Emma Goldman and his time spent in jail, where he learned that working class men could be gay, thus debunking the idea that homosexuality was a sign of upper middle class or wealthy exploitation or decadence.
Mikhail Kuzmin's novel Wings (1906) became one of the first "coming out" stories to have a happy ending and his private journals provide a detailed view of a gay subculture, involving men of all classes.