A man who tried to strangle a woman ended up being knocked out by a teenage boy with a glass candlestick.
Kevin Roberts throttled the woman until she began to turn blue.
But she was saved when the teenager intervened.
Roberts, 52, of Bramley Close, Louth, admitted a charge of attempting to cause grievous bodily harm and was jailed for six years after he appeared at Lincoln Crown Court.
Judge Michael Heath told him: "This was a sustained attack.
"You throttled her. If it had not been for the boy, whose courageous intervention does him enormous credit, the strong likelihood is that you would have killed that lady. "
Stephen Lowne, prosecuting, said that Roberts had been out for the evening with the woman and went back to her home alone.
He was asleep on the sofa when she returned.
She went to bed but Roberts burst into her room during the night.
"She remembers him placing his hands around her neck and starting to throttle her. After that point she remembers very little," Mr Lowne said.
Roberts then began to strangle the woman and during the attack began shouting that she was going to kill her before the boy intervened.
Mr Lowne said: "At first he tried to prise Roberts off. She was turning blue.
"The boy started to punch Roberts to the head. He punched him but it was not having any effect.
"Then he grabbed a bedside table lamp and started to strike the defendant about the head."
Roberts released his grip on the woman and fell unconsciousness but later came round and resumed the attack.
"The boy picked up a glass candlestick and hit the defendant over the head with that. Eventually Roberts entered into unconsciousness." Mr Lowne Said
Police arrived in response to the boy's 999 call and Roberts was arrested.
He later told officers he had little recollection of the incident.
The court was told that the woman was left severely affected by the attack.
Mr Lowne said: "She has had to leave the house where she lived because she cannot face going back there. She describes herself as a shadow of her former self."
David Eager, defending, said Roberts had never been in trouble before and simply "flipped". "He is a man of good character who has led a blameless existence. On this night for some reason he lost the plot."
Judge Heath praised the boy for his "courageous" intervention and directed the High Sheriff of Lincolnshire to award him £500 as an appreciation of what he did.