MOSCOW — If this article were published in a newspaper based in Russia, it could be labeled 18+ — like an X-rated movie — and start with the following disclaimer: “This article contains information not suitable for readers younger than 18 years of age, according to Russian legislation.”

Such warnings, put on any articles that discuss homosexuality or gay rights, are the result of a law nominally aimed at “protecting” children by banning “propaganda on nontraditional sexual relationships” but widely understood as an effort to suppress homosexuality and Russia’s fledgling gay rights movement.

The law, signed by President Vladimir V. Putin in June, has ignited international condemnation and blindsided the Kremlin with the sort of toxic political controversy that officials had desperately hoped to avoid ahead of the 2014 Winter Olympic Games in Sochi. The last Olympics on Russian soil, in 1980, was marred by the boycott over the Soviet invasion of Afghanistan.

The furor includes a boycott of Russian vodka in gay bars throughout the West and some calls for a boycott of the Sochi Games altogether. Beyond putting organizers on the defensive, it has cast worldwide attention on the cruel circumstances in which most gay people live in modern Russia.

Despite the breathtaking wealth and vibrant culture in the metropolises of Moscow and St. Petersburg, Russia remains a country where discrimination and even violence against gay people are widely tolerated.

“What is going on now in Russia contradicts its place in the world,” said Anton Krasovsky, a television anchor who was immediately fired from his job at the government-controlled KontrTV network in January after he announced during a live broadcast that he is gay, saying he was fed up with lying about his life and offended by the legislation.

Few gay people in Russia openly acknowledge their sexual orientation, and those who do are often harassed. When some gay people protested the propaganda law by kissing outside the State Duma, the lower house of Parliament, police officers stood by and watched as the demonstrators were doused with water and beaten by antigay and religious supporters of the bill.

An overwhelming 88 percent of Russians support the gay propaganda ban, according to a survey conducted in June by the All-Russian Public Opinion Center. A survey conducted in April by the Levada Center found that 35 percent of Russians believed that homosexuality was a disease and 43 percent believed that it was a bad habit, a result of poor parenting or a lack of discipline, or a symptom of abuse.

Last month, Patriarch Kirill I, the leader of the Russian Orthodox Church, called same-sex marriage “a very dangerous sign of the apocalypse.”

Image

The police detained a man after an attack on a gay rights activist in St. Petersburg.CreditAnatoly Maltsev/European Pressphoto Agency

Mixed signals from senior Russian officials over how the propaganda law might be enforced during the Games have undercut assertions by the International Olympic Committee that gay athletes and spectators have nothing to worry about, and have left organizing officials facing harsh criticism and demanding clarifications from the Kremlin.

There have been comparisons to Nazi Germany as host of the 1936 Olympics inside and outside Russia, including one by Jay Leno during an interview with President Obama last week on “The Tonight Show.”

“Something that shocked me about Russia,” Mr. Leno told the president. “Suddenly, homosexuality is against the law. I mean, this seems like Germany: Let’s round up the Jews. Let’s round up the gays. Let’s round up the blacks. I mean, it starts with that.”

Mr. Obama, on Mr. Leno’s show and again at a White House news conference on Friday, noted that Russia was not alone in its treatment of gay people, but he denounced the legislation and said he expected Mr. Putin and the Russian government to prevent any discrimination in Sochi.

“I have no patience for countries that try to treat gays or lesbians or transgendered persons in ways that intimidate them or are harmful to them,” he told Mr. Leno. At the White House, Mr. Obama said he opposed a boycott of the Games, but added, “Nobody is more offended than me by some of the antigay and lesbian legislation that you’ve been seeing in Russia.”

Russian officials say the criticism is unfair and inaccurate. In 1993, Russia repealed the Soviet-era law that made gay sex a crime.

“This is not about imposing any kind of sanctions against homosexuality,” Mr. Putin said, defending the propaganda law at a news conference in June. “This is about protecting children.”

He added: “The law does not in any way infringe on the rights of sexual minorities. They are full-fledged members of our society and are not being discriminated against in any way.”

Gay rights advocates disagree, saying the law is vague and can be used to arrest anyone who appears to support gay rights.

American rights groups, backed by athletes like Blake Skjellerup, a speed skater, and Greg Louganis, the gold medalist diver, are leading efforts to pressure Russia and the International Olympic Committee, including the vodka boycott and a petition signed by more than 300,000 people.

Image

Protesters held signs depicting President Vladimir V. Putin of Russia in London on Saturday.CreditLefteris Pitarakis/Associated Press

Some, like Stephen Fry, a British comedian who is gay, are urging a boycott of Sochi, while others want protests there to avoid punishing athletes.

Critics say Russia’s repression of gay rights is part of a pattern that also includes a tightening of pressure on civil society groups, and steps to limit foreign influences — all seemingly out of sync with Russia’s push to host international events, like the recently completed 2013 World University Games in Kazan and the international track and field championships now under way in Moscow.

Beyond Sochi, Russia will hold the World Cup in 2018 and is bidding for the World Expo in 2020. Asked if the gay rights issue might derail the bid, a spokeswoman for the deputy prime minister, Arkady Dvorkovich, noted that Russia was competing with Dubai, the United Arab Emirates, where homosexuality is illegal.

Russian gay rights advocates said the outrage in the West was providing new energy and financial support to their still relatively young movement. It is also raising pressure, including fears of increased violence.

“It’s not only a question of the period of the Olympic Games; here, there should be no law like this,” said Kirill Kalugin, 21, who was beaten by counterdemonstrators at a gay pride event in St. Petersburg last month and then detained by the police. “I feel very offended that I am being presented as an enemy of my own people.”

Mr. Krasovsky, the fired television anchor, likened life for gay people in Russia to that in the rural America in 1989, seven years before the Defense of Marriage Act became law. He also noted that in 1987, Britain adopted a ban on providing information about homosexuality to children nearly identical to the Russian law.

Aleksandr Smirnov, 39, a freelance journalist, said he was forced to quit his job in the press office of a deputy mayor in Moscow after he was featured with more than two dozen other gay Muscovites in a special issue of Afisha magazine in February. Being gay in Russia means “you are under permanent stress,” he said.

As for gay propaganda, he said the notion was ridiculous.

“Seven years ago, I wrote a letter to my mother, explaining my position, and I tried to explain to her that this has nothing to do with the existing stereotypes,” Mr. Smirnov said. “I told her that when I was about 13, I just felt, that, you know, I like boys, just the way the boys, not gays, at this same age, started to have feelings toward girls and women. I was not seduced. I was not lured into it, provoked into it. This happened quite naturally.”

Rights advocates said that Russia was growing more dangerous for gay people. This year, there have been at least two killings motivated by antigay bias in the country, including the savage beating death in May of a young man in Volgograd who was also sodomized with beer bottles.

Mr. Smirnov said that even in Moscow and in St. Petersburg, where there are large gay populations, as well as a thriving and visible gay night life that includes several gay bars and clubs, bias was inescapable.

“If you ask gays in Moscow whether they were attacked, or insulted, practically everyone will admit that it happened to him,” he said. “We are just at the very, very beginning of the movement for the rights of gays. And this new law, you know, it seals our mouths and ties our hands and feet.”

A version of this article appears in print on , on Page A1 of the New York edition with the headline: Gays in Russia Find No Haven, Despite Support From the West. Order Reprints | Today’s Paper | Subscribe