RIGA, Latvia — The first time this tiny Baltic nation held a gay pride march, the minuscule crowd was pelted with rotten eggs and bottles under the copper-green spires of Riga's medieval old city. The participants — all 40 of them — fled to safety in a church.
That was a decade ago. This year's parade drew thousands from across Europe, and the egg-throwers stayed at home.
Eastern Europe, long a stronghold of virulent homophobia, is reexamining attitudes toward gays and lesbians, and the debate has become a new battleground in the conflict between Russia and the West. The Kremlin has seized the opening, warning its former satellite states that if they align with decadent Europe, moral collapse will soon follow.
Russia's arguments have taken hold in Ukraine, Georgia, and other countries outside the European Union's high walls, where pro-Western leaders have resisted European demands for tolerance of gays and lesbians.
A gay pride march in the Ukrainian capital of Kiev last month ended in fistfights and controversy. Gay rights organizers in Georgia have called off public events altogether, after a 2013 march was beset by Orthodox priests wielding stinging nettles.
But in Latvia, which long ago made a firm choice to steer away from its old Kremlin overlords, tolerance of gays and lesbians has increased markedly in the 11 years since it joined the European Union. When the foreign minister, Edgars Rinkevics, came out as gay last fall, he predicted ''mega-hysteria'' — but the reaction was barely a ripple.
''The EU has helped. Latvians want to fit in,'' said Linda Freimane, a longtime Latvian gay rights activist who helped organize this year's parade, which drew people spanning the width of the 28-nation European Union.
The tug-of-war over gay rights has taken on special significance after a recent string of US court decisions upholding gay marriage. Caitlyn Jenner's very public transition from her old life as Bruce, meanwhile, has thrown a spotlight on transgender issues and acceptance.
In Latvia in 2005, hundreds of furious antigay counterprotesters poured into Riga's cobblestone streets on a July afternoon so drizzly that when they tried to burn a rainbow flag, they had trouble igniting it. The jeering crowds outnumbered the gay rights marchers, who were hemmed in by a thick cadre of police officers.
Latvia had joined the European Union just a year earlier, and membership in the club had just started to remake the nation's socially conservative attitudes.
Citizens suddenly had the right to travel and work anywhere in Europe they pleased, and they flocked westward in droves, to countries that are far more tolerant of gays and lesbians. A new generation has come of age with little or no memory of the Soviet era, when homosexuality was outlawed.
After the calm following the foreign minister's coming out on Twitter, ''People realized there wasn't this groundswell of homophobia in society,'' said Pauls Raudseps, a columnist for Latvia's Ir newsweekly.
But challenges remain. Just days before the gay pride parade on a recent Saturday, Latvia's parliament approved a law requiring ''virtuous'' education that includes promoting traditional marriage and family structures in the classroom. The measure was sponsored by Latvia's largest ethnic Russian party, but it was approved with support from conservative anti-Russian nationalists.