The unprovoked attack happened at Mosshall caravan park in Blackburn on October 29 last year, as Ms Edwards lay in bed.

Strachan repeatedly hit Ms Edwards on the head with a hammer. Afterwards he told police that he “presumed she was dead” and added: “I realised what I’d done. I was going to burn me and the caravan down.”

Prosecutor Alex Prentice said: “He struck her repeatedly on the head with a hammer forcing her to escape from the caravan by falling out of a window as he set a fire inside.”

Part of the incident was captured on CCTV.

Ms Edwards tried to open a window to get away from the attacker but continued to be struck as she made her escape.