Getting off in public might not land you in a cell, according to a new court ruling in Sweden.

Sweden's Södertörn district court has found that masturbating in public is not a crime if you are not targeting a specific person.

"For this to be a criminal offence it's required that the sexual molestation was directed towards one or more people. I think the court's judgment is reasonable," said Olof Vrethammar, public prosecutor. Vrethammar does not plan on appealing the ruling.

The decision was made after a 65-year-old man was arrested and charged with sexual assault after getting caught helping himself out on a beach in Stockholm, according to the Swedish newspaper The Local.

While there was not any documented evidence that the man had any sort of sexual disorder, the public display of a sexual act could be a sign of a sexual dysfunction or atypical sexual interest involving exhibitionism. However, the judge presiding over the case found that, since his actions were not directed at anyone in particular, he was technically not committing a crime.

This new ruling is a landmark decision because in many countries, masturbation is not only frowned upon, but also often prohibited. In the United States, some states have laws prohibiting not only the public display of a sexual act, but also private acts.

In 2009, Alabama upheld a statute prohibiting masturbation by artificial means — “any device designed primarily for the stimulation of human genital organs.”

Three years later in 2012, anti-abortion lawmakers in Oklahoma voted that masturbation and any other sexual act besides vaginal intercourse could be as harmful to unborn babies as abortion. “[A]ny action in which a man ejaculates or otherwise deposits semen anywhere but in a woman’s vagina shall be interpreted and construed as an action against an unborn child,” the amendment states, as reported by CBS News.

This decision by the district courts in Sweden might leave some citizens uneasy, and it is yet to be seen how many other countries will follow suit.