Two teenage girls were kissing and hugging on a rooftop in Marrakesh, Morocco, this week when a bystander took their photo.

After receiving the photo, a family member of one of the girls took them to the police station, where they were immediately arrested. They now face up to three years in prison for what is being deemed an act of homosexuality.

The two girls, identified to the Guardian as 16 and 17 years old are being held in a local prison — instead of the juvenile detention centre, according to a statement from the L’Union Feministe Libre, an organisation that said it met with the 17-year-old’s mother.

The girls are being charged with “licentious or unnatural acts with an individual of the same sex” under Article 489 of the Moroccan penal code, according to the statement. Punishment can range from six months to three years in prison.

The 17-year-old’s mother told the Moroccan Association of Human Rights that while visiting her daughter, she learned that she had been “mistreated by other prisoners”, according to CNN.

L’Union Feministe Libre strongly condemned the arrest as well as “the treatment they are suffering in prison,” it wrote.

“We call out the feminist’s movement, human rights associations and Moroccan lawyers to end the series of arrests Moroccan men and woman face on daily basis and the injustice we are now living in.”

The arrests spurred outrage on Twitter, where some urged people to use the hashtag #freethegirls.

The United Nations Working Group on Arbitrary Detention has ruled that arrests for such conduct are, by definition, arbitrary.

In spring of this year, a Moroccan court convicted a man for homosexual acts after he was beaten in his home and dragged naked onto the streets, Human Rights Watch wrote. A video clip appeared online with the assailants apparently uttering anti-gay slurs and “call the authorities.”

In July of last year, two women were arrested in Morocco on charges of “gross indecency” for wearing skirts after a market trader called out their clothing, the BBC reported. An article in the penal code says that anyone found guilty of “public obscenity” can face up to two years in jail.

On April 1, the Morocco’s Ministry of Justice unveiled a new proposed penal code that would supplement numerous provisions already criminalising extra-marital relations, homosexuality and the public consumption of alcohol.

A “surprising sense of revolt” spread across Moroccan social media in response to the proposed penal code, Merouan Mekouar wrote in The Post.