WARSAW, Poland — A court in Poland on Tuesday acquitted three activists who had been accused of desecration and offending religious feelings for adding the LGBT rainbow to images of the Virgin Mary and baby Jesus.

The three women created posters in 2019 that used the rainbows in place of halos in an image of the Madonna and Child. Their aim was to protest what they considered the hostility of Poland’s influential Catholic Church toward LGBT people.

The court in the city of Plock did not find any signs of a crime and also found that the activists were not motivated by a desire to offend anyone’s religious feelings or to insult the image of the Virgin Mary, according to reports in the Polish media.

The case of the three women was being watched in Poland as a test of freedom of speech under a deeply conservative government that has been seeking to push back against secularization and liberal views often seen as a foreign imposition. Abortion has been another flashpoint in the country after a top court ruling last year that resulted in a near total ban on abortion.

One of the defendants, Elzbieta Podlesna, said when the trial opened in January that the 2019 action in Plock was spurred by an installation at the city’s St. Dominic’s Church that associated LGBT people with crime and sins.

The image that they created involved altering Poland’s most-revered icon, the Mother of God of Czestochowa, popularly known as the Black Madonna of Czestochowa. The original has been housed at the Jasna Gora monastery in the city of Czestochowa — Poland’s holiest site — since the 14th century.

Podlesna told the Onet news portal that the existence of a provision in the penal code “leaves a door open to use it against people who think a bit differently.

“I still wonder how the rainbow — a symbol of diversity and tolerance — offends these feelings. I cannot understand it, especially since I am a believer,” Podlesna told Onet.

If Podlesna and the other two activists — Anna Prus and Joanna Gzyra-Iskandar — had been found guilty, they could have faced up to two years of prison.

An LGBT rights group, Love Does Not Exclude, welcomed the ruling as a “breakthrough.”

“This is a triumph for the LGBT+ resistance movement in the most homophobic country of the European Union,” it said.

Podlesna was arrested in an early morning police raid on her apartment in 2019, held for several hours and questioned over the posters of the icon that were placed around Plock. A court later said the detention was unnecessary and ordered damages equaling some $2,000 awarded to her.

Because of all the attention the altered icon has received, it is now also a very recognized image in Poland and is sometimes seen at street protests.