A stalker found hiding in a bed frame at his ex-wife’s house has been spared jail.
Shohidur Rahman, 42, had started showing up in the middle of the night and even shouting through her letterbox.
On one occasion, the police were called before Rahman managed to escape by jumping over a fence, Swindon Magistrates Court heard.
However, he returned a short while later and was eventually tracked down by officers who found him hiding in a bed frame in the garden of his ex-wife’s house.
The court heard Rahman had been in a 15-year relationship with his victim and they have two children together.
The relationship broke down around six years ago and Rahman left the country for a couple of years.
He returned to the UK around three years ago and has been turning up at his former partner’s home.
Prosecutor Keith Ballinger said he had convictions including breaches of a non-molestation order that prevented him from contacting his ex.
Rahman pleaded guilty to stalking and admitted breaching a conditional discharge.
He was sentenced to a two-year community order with 30 programme sessions, 20 rehabilitation days and a six month drug rehabilitation order.
A fine of £100 was deemed paid by time served on remand.
He was ordered to pay a £95 victim surcharge and given a two-year restraining order preventing him from contacting his victim.
Chairman of the bench Anthony Brown said: “I have to tell you, Mr Rahman, it was very close to sending you into custody.”
The court was told he had drug problems.