A gas board salesman was left shocked when a householder pulled out a knife and warned: "Don't smirk at me, I mean it, I'll cut you."

The official fled down the path but council house tenant John Bailey went on to terrorise a passer-by when he demanded money from her for food.

Bailey, 46, appeared in court yesterday and admitted causing an affray and attempted robbery on February 4.

But he avoided jail when the judge accepted he was suffering from a temporary adjustment disorder following the death of his brother and his mother being taken into care.

Judge Les Spittle told Bailey: "These are serious matters and, in particular the second charge of attempted robbery, but there are unusual features for both the cases.

"It appears that you are not suffering from any mental illness or psychiatric disorder that's ongoing, but you were at the time.

"Your reaction to material and substantial changes in your life created a temporary mental condition."

Bailey, of Willance Grove, Richmond, North Yorkshire, was given a prison sentence suspended for two years for each offence - 12 months for the affray and two years for the attempted robbery.

His barrister Christine Egerton had told Teesside Crown Court that Bailey had lived with his elder brother and his mother for 20 years until he died of cancer in May last year and she was taken into a nursing home with dementia on the same day.

"He found himself alone," said Ms Egerton. "Clearly he was having difficulty in coping."

Three days after he had threatened gas board official Geoffrey Ramsdale, and motorist Lesley-Ann Bright, police were called to his house where he was in his underpants, shouting and behaving oddly.

He was treated in a hospital's psychiatric wing for three weeks while experts identified the temporary adjustment disorder.

Prosecutor Deborah Sherwin said Ms Bright flagged down a passing car and fled after Bailey realised he had terrified her and apologised.

She said Mr Ramsdale had been unable to carry on his calls following his ordeal at the house.

In the last six months he has been reported more than 40 times.