A much-loved teacher took his own life after struggling with drug addiction and mental health problems, an inquest has heard.

Andrew Hanahoe, from Biggleswade, died after being struck by a train at a level crossing north of the town on December 29 last year.

In a statement, his wife Julie said the family were a tight unit and that their children – two together, and two from her previous marriage – adored Hitchin Boys’ School teacher Mr Hanahoe, who was 41.

The statement, read out by coroner Ian Pears during the inquest in Ampthill on Thursday, said that Mr Hanahoe had told his wife about his drug use as a teenager and said he was now clean.

But after being prescribed painkillers for back pain by his GP, Mr Hanahoe became addicted – and his use of other drugs spiralled out of control.

Julie’s statement described the sequence of events leading up to her husband’s tragic death.

“On Friday, December 29, Andrew phoned me and he asked to speak to the children,” it read.

“I then got a message saying ‘Tell kids I love t with all my heart.’ There was a spelling mistake as it should have read ‘I love them’ – which struck me as odd, as Andrew was always very careful about spelling and grammar.

“Soon afterwards I saw the air ambulance, and I just knew it was Andrew.”

Also read at the inquest was a harrowing statement from the train’s driver, Steven Rowley.

Judith Erickson from the British Transport Police told the inquest she was hopeful the foot crossing Mr Hanahoe crossed would be closed.

“Ideally this foot crossing should be closed,” she said.

“It crosses railway lines that have trains regularly passing over it at speeds up to 125mph. Biggleswade, like many towns, is growing – and any future development will bring housing closer to the crossing.

“I have an email from Nigel Meak of Network Rail which said he would personally like to remove the crossing altogether.”

Mr Hanahoe’s father Thomas told the inquest his son was “a very ebullient, delightful person, well liked by everybody he met.

“He was a very intimate part of our family and is very deeply missed by all of us.”

Mr Pears recorded a verdict of suicide.

Support charity Samaritans can be contacted free of charge on 116 123, 24 hours a day, 365 a year. You can also email jo@samaritans.org.