The incident occurred on June 6th at the Drevviken beach when the man removed his shorts and began masturbating close to the water. He was subsequently charged with sexual assault.
The Södertörn District Court has now acquitted the 65-year old in a judgement which stated that it "may be proven that the man exposed himself and masturbated on this occasion".
However, the court added that no offence had been committed as the masturbating man was not pleasuring himself towards a specific person.
Public prosecutor Olof Vrethammar told the Mitti newspaper that he wasn't planning to appeal the ruling.
"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 judgement is reasonable," he said.
When asked if it was now acceptable to masturbate in public if you don't direct it towards a specific individual the prosecutor said it was "okay."
"The district court has made a judgement on this case. With that we can conclude that it is okay to masturbate on the beach. The act may be considered to be disorderly conduct."
In another recent judgement a 15-year-old boy was acquitted after being previously charged with sexual assault. The teen had thrown his underwear into a lake and stood naked in front of two under-age girls.
The Södertörn District Court said that his behaviour did not have a sexual undertone and the charge was dismissed. Both the girls had requested the boy be charged with molestation.