L.G.B.T.Q. activists in Ukraine share the fight against Russia’s invasion.

To look at videos from last year’s Pride Parade in Kyiv is to peer at a joyous moment of solidarity in the quest for gay rights in Ukraine. A video on YouTube shows a cheerful crowd of thousands. Some wave flags. Some carry banners. Drag queens dance on a float.

But the war that started when Russia invaded on Feb. 24 has forced Ukraine’s L.G.B.T.Q. movement to confront a threat not only to national sovereignty, but also to its own community.

A pro-Russian puppet government, they say, would be less supportive of the L.G.B.T.Q. agenda. Gay marriage would likely remain unrecognized, they say, and incidents of discrimination and hate crime would rise, as they have in Russian-backed separatist regions.

Gay rights activists who have spent years struggling for equality have responded to the invasion with an intensified commitment to their cause, while mobilizing their network to offer support to people in need.

“What has amazed me is how the activist community reacted,” said Lenny Emson, who leads KyivPride and uses the gender-neutral courtesy title Mx. “It’s very encouraging how people work and how people did not stay inside panicking. They organized themselves for the community.”

The conflict has confronted people who are gay, lesbian or gender nonconforming with the same agonizing choices as the rest of the country’s 44 million people. Some have fled as refugees or moved to Ukraine’s west in search of safety. Others have stayed to help relatives or because they are trapped in besieged towns or cities. Still others have joined Ukraine’s defense forces.

At the same time, some people who are L.G.B.T.Q. have faced problems unique to their sex or gender identity. Mx. Emson said that she was aware of about 100 transgender women who were in the process of attaining legal gender recognition when the war started. After the invasion, Ukraine banned men between the ages of 18 and 60 from leaving the country to ensure they could be conscripted for military service. The transgender women are effectively trapped “because of the letter ‘M’ in their passports,” Mx. Emson said.

Some people who are H.I.V. positive no longer have ready access to medication. Neither do people in the process of gender transition.

Protests that led to a revolution in 2014, during which Ukraine’s pro-Moscow president was overthrown in favor of a western-leaning one, served to deepen ties between gay rights activists and other branches of civil society. The drive for human rights, which underpins gay rights, was central to the protests that centered on Kyiv’s Maidan Square.

President Vladimir V. Putin of Russia has promoted what he has called “traditional values,” and has denounced what he views as the West’s cultural decadence, which is taken to include the extension of legal rights and cultural acceptance to people who are L.G.B.T.Q.

One sign of how Mr. Putin’s values could potentially be applied to Ukraine comes from Crimea, said Maksym Eristavi, a Ukrainian gay rights activist and journalist. The region was seized by Russia from Ukraine in 2014, along with parts of eastern Donbas region. Human rights groups say both regions have seen a crackdown on human rights defenders and a rise in attacks on people who are L.G.B.T.Q.

“It just breaks my heart that we had eight years of fantastic success bringing Ukraine even further but now this is being sabotaged,” said Mr. Eristavi. Some recent Pride Parades in Ukraine have been met with counterdemonstrations, and rights groups point to a string of hate crimes in the country.

However, some activists say the overriding national goal of resisting the invasion could serve to increase the general public’s solidarity with people who are L.G.B.T.Q. Everybody is subject to Russia’s attacks, and straight Ukrainians can see that gay people are engaged in the same struggle for survival, several activists said.

Mr. Eristavi said the invasion “reignites the desire to fight back.”