WARSAW, Poland (AP) — Robert Biedron already made history once in Poland by becoming the first openly gay lawmaker in parliament in 2011. On Monday, he celebrated another first, becoming the country's first openly gay mayor.

The 38-year-old's political successes are a marker of how quickly this deeply conservative and Catholic country has changed in the decade since it joined the European Union. Back then, in 2004, gay rights marches were still being banned in Warsaw and homosexuality was treated as a huge taboo. Since then a growing acceptance of gays and lesbians has arrived hand-in-hand with a flourishing economy.

"I see how fast Polish society has learned its lesson of tolerance," Biedron told The Associated Press in an interview two days before he was elected Sunday to be mayor of Slupsk, a city near the Baltic Sea in northern Poland. "So I am very optimistic and happy with Polish society — and proud."

But it's not just him. In what the Polish media are calling "the Biedron effect," a record number of candidates also came out publicly before the local elections, which took place in two rounds over the last two weeks.

None of the others won seats, but gay rights activists are still hugely encouraged by the willingness of more and more public figures to come out. And their poor showing is partly because they were mostly young, first -time candidates with left wing parties, which saw little support.

"These people have enormous courage, in my opinion," said Mariusz Kurc, editor of a Polish gay advocacy magazine, Replika, who believes that the vast majority of political candidates in Poland still hide their identity.

He tells a story that shows the speed of the change. Before 2011 elections, he used his magazine's Facebook page to call on gay candidates still in the closet to come out. None did. But this around, people started writing in to say they would be happy to be publicly identified as gay, lesbian or bisexual. Nearly 20 had come out by election day.

"This was record breaking," Kurc said.