A homeless man has been sentenced to a community order for masturbating on the Longdendale Trail, near Hadfield.
Peter Woloszyinck, formerly of Charley Lane, Chinley, admitted the act of outraging public decency on May 6.
High Peak Magistrates heard on Monday he was spotted by a mother and daughter sat on a bench near Woodhead Road, in Torside, at about 3.20pm.
Prosecutor Jennifer Fitzgerald told the court the mother took a photograph to show the police and that the incident lasted several minutes.
She added it made the complainants feel “disgusted, physically sick and vulnerable”.
Annis Rowlands said her client recognised the distress and upset he had caused.
Chairman of the bench Eric Hilton said the offence would affect the victims for a long time.
Woloszyinck was ordered to comply with a two-year supervision order, a sex offenders programme and 120 hours of unpaid work, as well as pay £500 compensation, £85 costs and a £60 victim surcharge.