A "jealous and controlling" man escaped jail on Wednesday after inflicting months of fear on his ex-partner.

"It's a pattern of appalling behaviour for which you should be thoroughly ashamed," Judge Timothy Petts told 32-year-old Graham Parry at Caernarfon crown court.

"The complainant has behaved patiently in the face of extreme abuse and provocation."

Parry, a Welsh Water worker of Llwyn Onn, Rhos-on-Sea, pleaded guilty to a charge of putting a person in fear of violence by harassment.

He had been a month in prison on remand which the judge said should have served as a short, sharp shock. Instead of returning him to jail he imposed an 18-month community order, with 20 days of rehabilitation activity and 35 sessions of a "building better relationships" programme.

In addition he must carry out 100 hours of unpaid work and pay £800 costs.

A restraining order bans him from approaching or communicating with his victim or being in the Colwyn Bay street where she lives, and he must not approach her place of work. Also, he must not post any communications or pictures on the internet about her.

Karl Scholz, prosecuting, said Parry had continually turned up at her home or lurked outside, despite being told not to do so. He had also spat in his ex-partner's face. There had been as many as 30 phone calls a day and "she felt vulnerable and scared." He'd called her names and once pushed her by the hair. Parry had told her: "let the games begin".

In an impact statement the victim stated she felt she'd been "controlled and mentally abused".

Elen Owen, defending, said Parry had spent a total of £4,000 intending to have two family holidays with their two children - for which he would get none of his money back. "He is realistic that the relationship is well and truly over," declared Miss Owen. "It appears she has another partner."

A probation officer told the court that Graham had shown tendencies of a jealous and controlling manner and it was a concern that he continued to minimise and justify his actions. His victim had encountered fear and intimidation. Intervention by the probation service would seek to prevent similar behaviour in any future relationship.

The judge said the five-year relationship had broken down last summer and Parry had plenty of opportunities to stop his behaviour, being warned by the police.

"You have come within a hairsbreadth of going back to custody," added Judge Petts.