When President Andrzej Duda of Poland was sworn in on Thursday for a second term in office after a bitterly divisive campaign in which he rallied support by targeting homosexuality as a threat to the nation, he looked out over the floor of Parliament to find a sea of color.
But it was not a celebration. Many opposition lawmakers wore brightly hued outfits of red, yellow, blue and the rest of the rainbow in a show of protest. Their faces were covered with rainbow masks when Mr. Duda spoke, and they lifted copies of the Constitution above their heads.
No words were needed.
The rainbow flag, which first emerged as a symbol of solidarity for gay rights activists in the United States in the late 1970s, has become a touchstone in the culture wars that have left Poland more deeply divided than perhaps any point since the end of Communist Party rule in 1989.
And while there was speculation that the government would soften its rhetoric after Mr. Duda won re-election last month, that has not happened.
The arrest of three activists for hanging rainbow flags on monuments in Warsaw this week escalated already heightened tensions and came after government officials have for days been calling for the police to find and punish the perpetrators.
Leaders of the governing Law and Justice party have been emboldened by criticism from the European Union and its decision to withhold funding for six Polish towns that had declared themselves “L.G.B.T.-free zones.” The E.U.’s action represented a rare financial punishment of a member nation for issues related to the treatment of its citizens.
The party and its leaders have seized on the rainbow flag as a symbol of all the things that they say pose a threat to Roman Catholic values and the nation’s identity.
But the dispute has also galvanized critics of the governing party, who have seized on the flag as an emblem of opposition. For many, it represents not just solidarity with homosexuals, but also a rejection of what they view as a government-led campaign of intolerance, hatred and xenophobia.
So when gay rights activists seized on the announcement by the European Union that it was blocking funds, the flag was their weapon of choice.
They published a manifesto called “Stop the Nonsense,” declaring that it was time to fight discrimination.
“It’s an assault! It’s a rainbow. It’s an attack!” they wrote. “We decided to act. As long as I fear holding you by the hand. As long as the last homophobic delivery van doesn’t disappear from our streets, this is our manifestation of otherness — this rainbow.”
The mention of the vans refers to a common sight in Polish cities: trucks festooned with homophobic imagery that blare messages from loudspeakers accusing gay people of all sorts of vile crimes, including pedophilia.
The activists then posted pictures on social media showing rainbow flags hanging from important Warsaw monuments and pink masks strapped on the faces on some of the statues. The monuments included the Mermaid of Warsaw, a symbol of Poland’s capital city; a statue of the famed astronomer Nicholas Copernicus; a memorial to Jozef Pilsudski, the father of Polish independence after the World War I; and a statue of Jesus bearing a cross in front of the Basilica of the Holy Cross.
Sebastian Kaleta, Poland’s deputy minister of justice, said on July 29 that the acts should be met “with a firm reaction of our state.”
In his report to the police, Mr. Kaleta cited a Polish law against offending religious beliefs and insulting national monuments. The crime carries a possible sentence of two years in prison.
Prime Minister Mateusz Morawiecki posted pictures of himself on Facebook standing next to the statue of Christ.
“Each side of the great ideological dispute of our times — which grows ever bigger all over the world, and the effects of which we also feel in Poland — must understand that there are some lines of the level of aggression that cannot be crossed,” he said. “In Poland, we will not commit the mistakes of the West. We can all see what absolute tolerance toward pseudo-intellectual barbarity leads to.”
A few days later, at an Aug. 1 march commemorating the anniversary of the Warsaw Uprising in 1944, the leader of the ultraconservative National Movement, Robert Winnicki, compared the L.G.B.T. movement to Nazi and communist ideology.
“Every plague passes at some point,” he said. “The German plague passed, which was consuming Poland for six years, the red plague passed, the rainbow plague is also going to pass.”
The police in Warsaw announced on Twitter this week that suspects had been detained “in connection with the insult to religious feelings and demeaning Warsaw monuments.”
They were charged and released.
“There is no reason to detain people who are suspected of committing a crime that in the hierarchy of the penal code is just a minor offense,” said Anna-Maria Zukowska, an opposition member of Parliament.
Justyna Nakielska, who represents the Polish group Campaign Against Homophobia, said the arrests were meant to serve as a public spectacle.
“We perceive this as an attempt to intimidate and a clear message to the L.G.B.T. community,” she said, noting that the meaning was: “Be quiet.”
Anatol Magdziarz contributed reporting from Warsaw.