Two men have been jailed in Morocco for kissing in public, a penalty put in place after homosexuality in the North African country was deemed a criminal act. Above, some of the 1,000 Moroccans who demonstrated on Dec. 1, 2007, World AIDS Day, in the city of Casablanca. ABDELHAK SENNA/AFP/Getty Images

Two men in Morocco reportedly received four months of jail time Friday for kissing in public, an act that brought a conviction for an “affront to public decency” and an “unnatural act with a person of the same sex.” The two men, aged 38 and 25, must also pay a fine of 500 dirhams, or about $52.

Homosexuality is a crime in the conservative kingdom punishable by up to three years in jail. The law has been protested recently, most prominently with topless protests. The arrest and later conviction of the two men were the result of such protests.

They were arrested June 5 after kissing in front of a well-known Rabat landmark, the Hassan Tower, according to i24 News, an international current affairs and news broadcast. Their kiss was a protest against the deportation of two French women for kissing while topless during protests earlier this in June.

In a photo posted June 2 to the Twitter account of FEMEN, a feminist protest group that organizes the topless protests, the two women are seen kissing outdoors in Rabat. They are also in front of the Hassan Tower.

The two women were 25 and 30, and the phrase “in gay we trust” was written on their torsos. They were detained at the Rabat airport, but were reportedly later sent back to their home country and banned from Morocco.

Even with jail times, arrests and other punishments like these, the anti-gay laws in Morocco aren’t necessarily always enforced. For Patrick Baker, a politics lecturer in London, his experience as a gay man travelling in Morocco has been mostly warm and accepting.

“I think the best advice is to be streetwise: Bear in mind you are in a Muslim country where homosexuality is, at least in theory, illegal,” Baker wrote in an October travel column for the Guardian. “Get to know the local people and their views (some places are much more religious than others). In most cases, I believe that you will have a friendly and relaxed experience.”

The column was in response to the experience of a U.K. man on holiday in Morocco who was jailed after sparking a relationship with a Moroccan man. He spent 19 days in an overcrowded cell. The case sparked outrage, with some claiming that it exposed the restrictive anti-homosexual laws in Morocco.