Russia's parliament has passed two bills that impose jail terms for people promoting homosexual "propaganda" to minors and those who offend religious believers.
Ahead of Tuesday's vote, gay activists staged a kissing protest outside parliament but were outnumbered by several hundred supporters of the bill, some carrying religious icons.
Some threw rotten eggs at the gay protesters. After scuffles in which one man was knocked to the ground and kicked by the anti-gay activists, police began detaining the gay activists and bundling them into waiting buses.
A police spokesman said around 20 people were detained.
The bill against "homosexual propaganda" to minors sailed through the State Duma lower house of parliament in a 436-to-0 vote with one abstention.
The measure is part of an effort to promote traditional Russian values as opposed to Western liberalism, which the Kremlin and the Russian Orthodox Church see as corrupting Russian youth and contributing to the protests against President Vladimir Putin's rule.
After the bill was given preliminary approval in January, legislators changed the wording of "homosexual propaganda" to "propaganda of nontraditional sexual relations," which backers of the bill defined as "relations not conducive to procreation".
The draft law would only raise the level of intolerance in Russian society.
Critics fear the measure will be used to justify the repression of gays amid rising homophobia in Russia.
Russia decriminalised homosexuality in 1993, but anti-gay sentiment remains high. Russia is also considering banning citizens of countries that allow same-sex marriage from adopting Russian children.
The legislation will impose hefty fines for providing information about the lesbian, gay, bisexual and transgender community to minors or holding gay pride rallies. Breaching the law will carry a fine of up to $156 for an individual and up to $31,000 for media organisations.
The controversial bill applies to Russians and foreigners as well as media organisations.
It makes it an offence to say that gay relationships are equal to heterosexual ones.
According to another bill, passed in a 308-to-2 vote, "public actions expressing clear disrespect for society and committed to the goal of offending religious feelings of the faithful" would be punishable with jail terms of up to one year and fines of up to $9,000.
The same actions committed in places of worship would be punishable by up to three years in prison and a fine of up to $15,000.
The bill was proposed after five members of the Pussy Riot punk rock band belted out a "punk prayer" against Putin in a Moscow cathedral last year.
The stunt exposed faultlines in the predominantly Orthodox country, with critics saying the punk rockers offended the faithful and supporters saying their counter-culture performance targeted Putin and the Church's close ties to the Kremlin.
After the Duma passes a bill in its third reading, it must then be passed by the senate and is finally signed into law by Putin.
Rights activists and Western governments have criticised both bills as part of an unprecedented crackdown on dissenters after Putin returned for a third term last year.
"The draft law would only raise the level of intolerance in Russian society," said the New York-based Human Rights Watch, referring to the ban on "homosexual propaganda."
But the bill's supporters say traditional relations need to be protected by the government.
"Traditional sexual relations are relations between a man and a woman," said one of the bill's authors, Yelena Mizulina of the Kremlin-friendly A Just Russia party.