WARSAW, Poland -- Robert Biedron already made history once in Poland by becoming the first openly gay lawmaker in parliament in 2011. On Monday, he became 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 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 change. Their poor showing can be attributed largely to the fact that 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 time 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.

Kurc's group included Joanna Erbel, a Warsaw mayoral candidate who spoke out about being bisexual four days before the first round of voting on Nov. 16. Representing the small Green party, she won less than 3 per cent of the vote and was eliminated from a runoff, but she doesn't believe that being bisexual was a factor either way.

Biedron, an independent who was named one of the country's best lawmakers this year by the weekly magazine Polityka, represents a cultural shift in other ways too.

He inherits a city that is one of the most indebted in Poland and has pledged to transform it by cleaning up city hall and reviving the moribund economy with investments in green energy. He is vowing to live modestly, saying he will forego the traditional perk of a luxury car and chauffer in favour of public transportation and bicycle.

To his surprise, that plan hasn't always gone over well. "Many people approach me and say, 'no, the mayor of the city must have a nice car and a driver,"' he said. "They think you must underline your importance."

During the campaign, he also got out onto the streets to talk to the voters, something that surprised people used to only seeing candidates on campaign billboards or in televised interviews.

And he is finding support in unlikely places.

He attended a local soccer match during the campaign and was heckled with homophobic slurs. After the first round, he was by chance approached by one of the men who shouted the insults.

"He said, 'of eight candidates you were the only one we didn't expect, but you were the only one who came to our game. You have courage, so we voted for you,"' Biedron recalled.