A grandfather who pleasured himself in front of two nine-year-old girls has walked free from court.

John O’Connor, 58, exposed himself while exercising naked in front of a lounge window at his Hornsey flat as children played in a communal garden, Wood Green Crown Court heard.

Youngsters told police they had looked on as he performed a bizarre solo sex act involving a piece of string.

They witnessed similar scenes on 10 occasions from November 2008 to May last year, the court heard.

One girl is now receiving counselling and both were “psychologically harmed” by O’Connor’s behaviour.

Judge Nicholas Browne QC allowed O’Connor, who now lives in Enfield, to walk free so he could receive treatment. He said: “None of your offences involved touching either of the girls. If it did, prison would have been inevitable. I would not be protecting society, or you, if I sent you to prison immediately. That would provide short-term protection but this needs long-term protection.”

O’Connor admitted four counts of engaging in sexual activity in the presence of a child. He must attend a community sex offender programme and will be supervised for two years.