A family of four were trapped in their burning house after an arsonist “mistakenly” targeted their home.
Nathan Lee Jones, of Golwg y Castell, Cardigan, set bin bags alight outside their home on Castle Street on 16 June 2020.
Police later found out that Jones had intended to set fire to a different house, but got the address wrong.
Jones pleaded guilty to arson with intent to endanger life, and was jailed for four years at Swansea Crown Court.
Dyfed Powys Police said Jones had gone back and tried to put out the blaze, which was started in the early hours of the morning.
Det Con Damon Watmough said: “However it appears a black bag was still smouldering, and spread to the other refuse outside the house.
“By the time the occupants were aware, they had no means of escape, and a gas pipe had been damaged and was leaking into their home.”
Mr Watmough said it was initially thought the fire had been caused by a lit cigarette, but it was later proven it was started deliberately.
Jones was spotted on CCTV at the house at around the time of the fire, and was identified through conversations on social media, he added.
“This was a very serious and traumatic incident, which could have had devastating consequences for the victims,” Det Con Watmough added.
“The defendant was determined to cause fear or harm by starting the fire, and put the lives of a family with two young children at risk.
“We hope this sentence will provide reassurance to the community and victims following this distressing incident.”