An arsonist set fire to his former girlfriend's home after a series of sinister text threats.
The woman was away for the night when Christopher McGow sparked the blaze, which caused damage throughout her house but an elderly, housebound neighbour suffered smoke inhalation.
The pensioner's home was also smoke damaged by the blaze.
At Newcastle Crown Court the 26-year-old fire starter was told he was lucky not to be facing a murder charge.
Judge Tim Gittins sentenced McGow, who was on a suspended jail term for theft, to four years and three months behind bars.
The judge said McGow could not have been certain that the woman and her little girl were not in the house, in Appleby Square, Sunderland, when he started the fire at their front door.
Judge Gittins added: "If they had been in, you would have been facing a murder charge, given the damage and the location of the fire, going up the stairs.
"It is very unlikely they would have got out alive.
"That is the danger of starting fires. They can be unpredictable, they can be out of control in the blink of an eye."
The court heard it is unclear if McGow used an accelerant when he started the fire at the front door of the house last October.
During the build up to the blaze, McGow had warned the woman by text "I will have the last laugh" and "watch out pet hahaha".
As a result, she and her daughter had gone to stay with her sister.
It was during the early hours, her housebound neighbour was woken by the sound of guttering collapsing because of the flames.
The pensioner managed to get out of her house, still in her nightgown, and shout for help but went back inside when nobody heard.
After ringing for the emergency services, she was told to stay outside but could not stand the cold so went back to her living room, which was filling with smoke.
Prosecutor Daniel Cordey told the court: "She thinks she passed out. She was woken by a fireman and later saw the paramedics.
"It was clearly a traumatic incident for that lady."
The court heard the pensioner refused to go to hospital despite advice.
Mr Cordey said while McGow, who was intoxicated when he sparked the blaze, may not have been certain if his ex girlfriend was at home, he knew a vulnerable pensioner was living in the adjoining house.
McGow, of Roker Avenue, Sunderland, pleaded guilty to arson being reckless to whether life would be endangered.
The woman told police it was "pure luck" she and her daughter stayed with her sister that night and said she gets upset "thinking about how close they were to death or serious injury".
Paul Cross, defending, said McGow was "full of remorse " for what he did.
Mr Cross said despite McGow's previous convictions, he is able to stay out of trouble for long periods and hold down jobs.
McGow claims he knew the woman was not at home when he started the fire.