In Vladimir Putin’s Russia—official Russia—there is no controversy about the rights of gays and lesbians. Controversy suggests a serious clash of ideas and opinions; controversy suggests points of view that are in opposition and, potentially, subject to change. This is not the case when it comes to the human rights of homosexuals in Russia. In the Kremlin, in the parliament, in the courts, in the hierarchy of the Russian Orthodox Church, and on television there reigns a disdainful and intimidating unanimity: homosexuals are a threat to morality, to the family, and to the state. In the words of Masha Gessen, a journalist and longtime activist, “They want to throw us back in the closet.”

In June, the Russian parliament, the Duma, passed a law barring “propaganda” about “nontraditional sexual relations” without a single dissenting vote. (Some local legislatures, including those of Ryazan, Arkhangelsk, and St. Petersburg, had already approved versions of their own.) The national law is an extraordinary expression of hysterical and vindictive homophobia. The law defines the offending “propaganda” as “the purposeful and uncontrolled distribution of information that can harm the spiritual or physical health of a minor, including forming the erroneous impression of the social equality of traditional and nontraditional marital relations.” It effectively prohibits gay-rights demonstrations, opens the door to implicitly sanctioned discrimination, and inflicts second-class citizenship on gays and lesbians in Russia.

Putin claims that the law does nothing to infringe on the lives and rights of homosexuals (“They’re people, just like everyone else”); he insisted that the Russian people supported the legislation and, thus, must have it; he also says he is concerned that homosexuality is contributing to the country’s low birth rate.

Activists find this disingenuous at best. The law insures discrimination and provides a xenophobic regime with an Other to rally against. The activists also contend that the legislation is part of a larger ideological and legislative effort in Russia that seeks to stigmatize nongovernmental organizations as “foreign agents” and the West, in general, as a threat. The leadership invokes an anti-gay rhetoric reminiscent of the way Soviet leaders used to denounce Jews as “internal enemies,” the agents of foreign capital and spy services. Human-rights groups and L.G.B.T. organizations in Russia say that the law has opened the door to real misery: this year alone, they have documented hundreds of acts of violence, including murders, against gay men and women; workplace discrimination; and hateful (and sanctioned) rhetoric in the official media.

When I lived in Moscow, as a correspondent for the Washington Post, in the late nineteen-eighties and early nineties, an extended period of general, even euphoric liberalization was in full swing. Most of it centered on the easing of strictures on the press and on cultural and political life; it only slowly extended to sexual issues. Gays and lesbians still lived in the shadows. The Great Soviet Encyclopedia referred to homosexuality as “a manifestation of Western decadence.” Boris Malenkov, the chief sexual pathologist of the hospitals in Leningrad, told a local paper that homosexuals should be registered by the state so that “they can be treated.”

I remember talking with gay men, who cruised the park in front of the Bolshoi Theatre and hung out in a grim restaurant called the Sadko Café; they said they were still terrified of harassment from police and street thugs. They spoke with intense longing of the new freedoms that gays were experiencing in the West. Igor Kon, a pioneering sociologist specializing in sexuality, told me then, “People here think gays are depraved and want nothing more than rough sex or to seduce children. To change such attitudes would take a lot of time. Just to begin the discussion is dangerous.”

And yet there were signs, in those days, of bravery and better things to come. An activist named Roman Kalinin put out a gay-oriented newspaper called Tema. Later came tiny publications, such as Gay Pravda, The Partner, and Queer, and, much later, such online presences as Radio Indigo and Gay Rainbow. An especially audacious activist named Yevgenia Debranskaya would get arrested quite often at pro-democracy rallies and, in jail, shout through the bars, “I am a lesbian!”

In 1991, people came from all over the country to a gay-film festival that played in both Moscow and St. Petersburg. In 1993, with Boris Yeltsin in power, the Russian government very quietly got rid of Article 121, the anti-sodomy laws, which had also, at times, been used to prosecute dissidents. The move hardly reflected a disappearance of homophobia in Russia; no small part of the motivation was to win acceptance for Russia abroad.

But, for a decade or so thereafter, life seemed relatively more relaxed for gays and lesbians. Gay bars and discos appeared. Various small L.G.B.T. groups formed, more as community-building organizations than as overtly political groups. In those years, Gessen told me, “people were living in what they thought was a normal country—not Western Europe, but not the Soviet Union, either.” Their lives were getting better; now, having come out, they are exposed and deeply vulnerable. “Their friends knew, their neighbors knew, their pediatrician knew. Now we have nowhere to go, not even the closet.”

Putin, who came to power in 2000, had worked in the secret services and was far less inclined toward tolerance. A couple of years ago, I was talking about human-rights issues with Dmitri Peskov, Putin’s close aide and spokesman, and he broke out in a wide smile.

“Actually, coming here in the car I was listening to the radio,” he said. “Do you know what was the first item on the news? The State Department of the United States expressed its gravest concern about the policy in Russia toward gays!” Peskov was referring to a version of the gay-propaganda law, which was then before the legislature in St. Petersburg. “I thought, What is the State Department of the United States doing? With their national debt! With their collapsing economy! With a leak of industry in the country because everything is in a financial bubble! With a nightmare in Afghanistan, with a nightmare in Iraq, with a nightmare in the global economy! And they have a deep concern about gays in Russia. Ha-ha! So I was really in a very good mood because of this!”

The Russian officials I meet always seem surprised that so many Westerners care at all about the rights of gay men and women. A few days ago, a senior official told me that such concerns were the inventions of the Western press. The reaction to questions about gay rights is usually either dismissive laughter or anger at what they view as self-righteous foreigners determined to embarrass Russia. When Putin went to Amsterdam in April, the city flew the rainbow flag, and he was confronted with questions about the propaganda law; he fumbled through his answers.

Even as anti-gay legislation began moving through the provinces and the prospects for gay life were dimming, a younger generation raised in post-Soviet circumstances seized what liberties were available. The Putin regime directs nearly all of its propagandist attentions to television, leaving some liberal outlets, like the radio station Ekho Moskvi (Echo of Moscow) and the Web television station Dozhd’ (Rain), more or less to their own devices. (Putin’s system of targeted censorship is far less expensive than the totalist Soviet version.) Two Moscow city magazines, Afisha and Bolshoi Gorod (Big City), recently published astonishingly good special issues devoted to gay life, with stories and analyses as varied, deep, and liberated as those you would hope to find anywhere in the world.

But the general picture presented to the vast majority of the public through state television is miserable and threatening. Last month, on Rossiya 1, a well-known host named Arkady Mamontov devoted an episode of his show “Special Correspondent” to the topic of homosexuality. He and his reporters portrayed gay activists as Western-funded agents out to corrupt the moral foundation of the country. Mamontov said, “Western sodomites are trying to sneak into Russia and mobilize a protest movement among our own perverts.” The meteorite that had crashed down on the city of Chelyabinsk was a warning from God, he said; if the indulgence of homosexuals continued, Russia would, like Sodom and Gomorrah, be destroyed for its moral turpitude.