Jan Dvorkin had raised and nurtured his adopted son in Moscow for seven years until, one day in May, the Russian authorities notified him they were revoking custody. A woman Mr. Dvorkin knew had filed an official complaint, saying that because he was transgender and gay, he was an unfit parent.
When Mr. Dvorkin asked the woman why she had reported him, she told him he had brought it on himself, and “that I could have easily avoided it by staying in the closet.”
He managed to find another family to take the boy, who is deaf, so that the child would not be sent to an orphanage.
Mr. Dvorkin’s experience underscores the increasingly repressive treatment gay and transgender people are subjected to across Russia — a hardship that seems certain to grow as the government leverages the war in Ukraine as justification for greater restrictions on L.G.B.T.Q. life.
Critics, including legal and medical professionals and gay rights activists, view the campaign as an effort to distract from Russia’s military failings in Ukraine — by creating a boogeyman it can portray as a threat from a deviant and corrupt West.
“It is a common practice to look for internal enemies when their external enemy turns out to be tougher than expected,” Mr. Dvorkin, 32, said in an interview from Moscow. “With no success on the front line, Putin found an easy enemy, a vulnerable group whom he can defeat in Russia.”
As with many repressive measures, Mr. Putin himself seemed to have inspired the law.
Long before his invasion of Ukraine, Mr. Putin had scorned the idea of gay rights. But as his military stumbled, he began to rewrite the war as a Western attempt to undermine Russian security and “traditional values.”
He took aim at questions of gender identity as well as sexual orientation, regularly denigrated transgender people in his speeches, mocking the idea of “Parent No. 1 and Parent No. 2” instead of “mom and dad,” and suggested that the West sought to make the world adopt “dozens of genders.”
The new law bans all gender transitions as well as changing genders on official documents like passports. It became harsher as it proceeded in Russia’s Parliament; typically a rubber stamp for Mr. Putin’s favored legislation, it overwhelmingly passed the law. The final version annuls marriages when one spouse changes gender and bans adoptions by such couples.
The law essentially removes the ability of transgender people to control their own bodies, rights activists said, and even if people had the means to travel abroad seeking surgery, which many do not, they would not be allowed to update official documents. Having the wrong gender on identification papers would create hurdles in countless aspects of life such as employment and travel.
The new law also bans treatment with either estrogen or testosterone, which are typically taken before undergoing transition surgery. There are limited exceptions for people who had started the process and already changed documents.
Critics said the ban could lead to what is essentially a black market for the drugs. One transgender person in St. Petersburg said that a clandestine lab there was already attempting to make estrogen from over-the-counter drugs. Illicit testosterone was a bigger challenge, said the person, who insisted on anonymity to avoid retribution.
Surveys by the independent pollster Levada show that, over the last decade, the Kremlin’s propaganda campaign against the L.G.B.T.Q. community may have affected Russian attitudes: The percentage of respondents who said they viewed gay people with disgust or fear increased from 26 percent in 2013 to 38 percent in 2021.
In 2013, the first Russian law against disseminating “gay propaganda” was framed as protecting children. This time, with the war as a backdrop, the law banning gender transition was presented as a matter of national security.
“The war is not only on the front line, the war is going on in the minds and souls, and we want to protect our country from being destroyed from within,” Pyotr Tolstoy, a hard-line deputy speaker of Parliament, wrote on Telegram.
The concept of national security has become an increasingly fluid one, said Max Olenichev, a lawyer who defends L.G.B.T. people. “It has become an ephemeral thing that can mean absolutely anything,” he said. “Whenever you do not want to give a reason, just say ‘national security.’”
The law also corresponds with Mr. Putin’s attempt to portray Russia as a bastion of what he calls “traditional family values,” a longstanding effort to appeal to conservative voters at home and abroad.
The hope is that support for his social agenda will extend to endorsing the war, said Alexander Kondakov, a sociologist at University College Dublin. “By targeting a group that is already marginalized, they amass support for the war and any other cause that the government wants,” he said.
For the L.G.B.T. Q. community, the law was yet another blow.
Mr. Dvorkin described the mood among transgender people as “dark and depressing,” with members bracing for more hate crimes. “There was already an increase in vocal hate groups, and since the law passed they have gone off the rails,” he said.
Violence against gay people surged after the 2013 law, said Mr. Kondakov, who studies the intersection of law and security for the L.G.B.T. community. Prosecutions also jumped after the stricter version passed last December, according to a report by Novaya Gazeta Europe, an independent newspaper.
Mr. Dvorkin, who began transitioning at 28, is the founder of Center T, which offers medical and other advice to thousands of transgender people. The government recently designated the organization a “foreign agent,” a label whose onerous requirements carry an automatic stigma, and he fears it will soon have to shutter or go underground.
Mr. Dvorkin began looking for a new home for his son not long after the stricter law passed last December. Repeated warnings from the children’s services office, which supervised the adoption, against discussing his gender identity and sexual orientation online, as well as a court-imposed fine, signaled that his custody was in jeopardy.
His son, now 10, also had a kidney disease. In June, Mr. Dvorkin struggled to locate a family willing to take him. He finally persuaded one to do so, then managed to convince officials not to return him to an orphanage.
Use of hormones and surgery for transgender people was first accepted in the Soviet Union in the 1970s, and by 2017 Russia had developed what many considered a rational approach, leaving the decision up to a panel of doctors and psychiatrists.
Gender transition had not been much of a political issue in Russia until now. Initially, the Ministry of Health questioned the need for any change, but it soon surrendered to browbeating by Vyacheslav Volodin, the chairman of Parliament, who accused officials of pursing an American agenda by seeking to emulate “Sodom.”
Although overall numbers are not readily available, Mr. Volodin said that 2,700 people had currently been approved for gender transitions by the ministry; the source of the number was unclear. Russia’s population is more than 143 million.
In St. Petersburg, the person who described the clandestine lab, who uses the pronoun they, rushed to finish the process of being legally recognized as a woman before the law took effect. Describing it as “anarchistic escapism,” they said they invented a new, unusual first name whose spelling looks like someone smashed a keyboard with a fist. They said they assured the bureaucrat reading the application it was a traditional Siberian name.
“The best thing we can do is to resist this state by simply existing,” they said.
Milana Mazaeva contributed reporting.