On Friday, Ilya Kolmanovsky, who is straight, stood outside Russia’s lower house of parliament to protest an anti-gay bill. He avoided arrest, but on Monday, when he went to the school where he teaches ninth-grade biology, he was fired.

While many countries, including the United States, are fighting discrimination based on sexual orientation, Russia seems intent on intensifying it. On Friday, as Kolmanovsky stood in the freezing cold, the state Duma passed the first reading of a bill prohibiting distribution of “gay propaganda” to minors, which opponents fear would make gay pride marches, demonstrations for gay rights and public displays of affection by same-sex couples illegal. Moscow already bans gay pride parades on the grounds that they might set off public disorder.

The Duma voted 338 to 1 for the bill, which requires two more readings. One of the 450 deputies abstained, and 52 avoided voting. A member of the ruling United Russia party justified his “yes” vote thus: “We live in Russia, not Sodom and Gomorrah.”

The national bill follows the passage of similar laws in St. Petersburg, Novosibirsk and three other cities, tapping into an ideology promoted by President Vladimir Putin and his circle that combines anti-Westernism, Russian exceptionalism and conservative Orthodox religious beliefs.

“This is part of a concentrated effort by the Russian authorities to create a new political cleavage between the conservative, pro-Putin majority and the more liberal, pro-Western minority,” Grigory Golosov, project director for the Center for Democracy and Human Rights Helix in St. Petersburg, said by telephone Tuesday. “They have to invent issues around which such a cleavage can be manufactured.”

Russia's president cracks down on dissent.

In the long run, that could prove a challenge for Putin, said Golosov, adding that history shows it is difficult to manufacture such a rupture. But in the short term, there is no doubt the anti-gay law will pass.

As for the plight of sexual minorities here, Golosov described it as “collateral damage.” Russia decriminalized homosexuality in 1993, but a poll by the independent Levada Center in August reported that 62 percent of respondents found it morally unacceptable.

Confrontation, discussion

When Kolmanovsky, who is also a science writer, joined the protest Friday, he came upon about 20 gay rights advocates and many more supporters of the anti-gay bill. Some same-sex protesters were kissing, and a group of Orthodox activists, some masked, were singing hymns and harassing them.

Police carted off 15 from the kiss-in group and five of the others, Kolmanovsky said. “I was evasive, and they didn’t take me.”

That left him pretty much alone amid a threatening crowd shouting homophobic epithets at him. Some told him that people could become gay by seeing same-sex couples kissing or by hearing that gays had equal rights or were as normal as straight people. Kolmanovsky was there to offer a scientific argument that sexual orientation is determined in the womb or soon after. They were reluctant to listen.

“I showed them my wedding ring and said I had two children,” Kolmanovsky said. “Amazingly, they just threw one egg at me, and we managed to have a discussion . In Russia, you don’t have space for public discussion. We had a discussion, which was very important. They were listening, and I was listening .

Drama at school

On Saturday — Russian high schoolers attend classes six days a week — Kolmanovsky went as usual to School No. 2, where he has taught for seven years. As he was teaching the Mendelian laws of genetics, the foundation of all modern genetic theory, threats were being posted on the school’s Web site.

Those who put up the posts described themselves as parents of his students, which Kolmanovsky said he didn’t believe. But they vowed to complain to higher-ups in the education system, and Kolmanovsky got a call from the vice principal, who was furious about the flare-up. Complaints to higher-ups could pose a threat to the principal and the school in a system in which everything depends on goodwill from above — meaning, from Putin on down. On Sunday, the vice principal responded to the postings on the school Web site, calling Kolmanovsky, who is in his mid-30s, a silly hothead. “I promise you we will beat this silliness out of him,” the vice principal wrote. “He’s not gay. He’s a model family man. And he never cheats on his wife.”

Kolmanovsky knew it was an attempt to save him, but he was angry. “What matters is freedom of speech,” he said.

On Monday morning, Kolmanovsky went to the principal’s office, where he confronted the wounded collective consciousness of Russia’s older generation.

When Vladimir Ovchinnikov was the school’s founding principal in 1956, he presided over a hotbed of dissidence and individual thinking that was unwelcome in the Soviet Union. When the nation’s leader, Nikita Khrushchev, ordered schools to give students practical experience in factories, Ovchinnikov placed his in scientific labs.

The school become known for its excellence in math and science and boasted a roster of outstanding graduates. But in 1971, Ovchinnikov got a lesson in freedom of speech when he was fired for allowing too much free thinking. He found another job, but by 2001, the tide had changed, and he was rehired as principal of the prestigious school.

When Kolmanovsky entered his office, Ovchinnikov, now 84, showed him printouts of the threats. “You did something very stupid,” Kolmanovsky quoted Ovchinnikov as saying. “I don’t understand why you didn’t resign. You’re fired.”

On Monday night, Kolmanovsky posted an account of the ordeal on the Radio Liberty Web site. When parents, alumni and admirers of the school heard the news, they began complaining. Their voices, it turned out, were the more persuasive.

By Tuesday afternoon, the principal had reinstated Kolmanovsky, who was saddened that a man he deeply admires was by this time being vilified in online comments. More collateral damage, Kolmanovsky said. “It’s not me or him — it’s the system that’s to blame.”

Later, the principal said he had never fired Kolmanovsky and was happy that he would continue teaching at the school.

Liberal Russians could only mourn the episode and what it represents.

“Homophobia raised to the level of state politics is classic fascism,” Georgy Satarov, a Boris Yeltsin-era liberal and head of the anti-corruption Indem Foundation, wrote on his Facebook page. “Do you want your children to study under fascism?”