Polish opposition members of parliament coordinated their outfits on Thursday to create a rainbow flag for President Andrzej Duda’s swearing-in ceremony.

Duda is a staunch ally of Poland’s ruling right-wing nationalist Law and Justice party (PiS), which strongly opposes LGBTQ+ rights.

During his presidential campaign, he ramped up the anti-LGBTQ+ rhetoric in an attempt to win over his conservative fanbase by blasting marriage equality and vowing to ban same-sex couples from adopting children.

He also signed a declaration called The Family Card that would ban LGBTQ+ lessons in schools to protect children from so-called “LGBT ideology.”

To show solidarity with the LGBTQ+ community, the 10 MPs – from Poland’s “Left” grouping – all wore rainbow masks and outfits in the shades of the rainbow as Duda was sworn in in the lower house of parliament, the Sejm.

Photos can be seen of them inside and outside parliament with rainbow and white and red Polish flags.

“We wanted to remind President Andrzej Duda that … in the constitution there is a guarantee of equality for all,” said Left MP Anna Maria Zukowska. “We don’t want a similar situation during his next term as there was during his campaign, when the president dehumanized LGBT people by denying them the right to be people.”

Magda Biejat, another MPs from the left-wing Razem party, wrote on Twitter: “The president of Poland should defend the rights of all citizens.”

As Duda was sworn in, he reiterated his pledge to keep “family as the foundation stone of society … as our most precious good.”

Last week, the European Union denied funding to six towns in Poland that declared themselves to be “LGBT-free zones.”

“EU values and fundamental rights must be respected by Member States and state authorities,” European Commissioner for Equality, Helena Dalli, wrote on Twitter.

“This is why six town-twinning applications involving Polish authorities that adopted ‘LGBTI free zones’ or ‘family rights’ resolutions were rejected.”

The towns, which haven’t been named, asked to join the EU’s twinning project which links different towns together to “guarantee peaceful relations” and “reinforce mutual understanding and friendship” between European citizens.

Ursula von der Leyen, European Commission President, said in a statement on Twitter: “Our treaties in Europe ensure that every person in Europe is free to be who they are, live where they like, love who they want and aim as high as they want. I will continue to push for a #UnionOfEquality.”

In response to the EU’s decision to deny funding, Janusz Kowalski, the Polish Minister for State Assets, said the whole of Poland should be an “LGBT-free zone,” noting that the country’s constitution only recognises a family as between a man and a woman.

“We must not allow a single euro to be taken from Poland, Polish local governments, any Polish institutions for complying with the law, for saying ‘no’ to LGBT ideology, for protecting the Polish family,” he told Rzeczpospolita.

“First and foremost, Poland should be a LGBT-free zone. We should adopt a law that prohibits financing from public funds, or at the state or local government level, of any activities of organizations that explicitly promote LGBT.”

Related: Poland airs first ever television commercial with a gay couple.