An arsonist endangered the lives of residents of a block of flats and caused over £30,000 of damage by torching vans at business premises.
Matthew Hughes, 21, committed the offences after getting drunk with his mother at her flat in Featherstone.
A court heard Hughes also made racial threats and exposed himself as he was filmed when he continued to be abusive.
Hughes was given an extended seven year prison sentence over the incidents which took place on September 4 this year.
Robert Galley, prosecuting, told Leeds Crown Court how Hughes’s mother moved into the flats in late August this year.
Residents had seen him loitering around the building and using a lighter to melt light switches in order to set off the fire alarm. Later that day he lit a fire on the top floor landing area which spread to a stairway. Residents managed to put the fire out.
One later told police: “Should the fire have taken hold we would have been trapped inside our flats.”
Hughes then entered a secure compound at a nearby business premises and set fire to vans. Two were completely destroyed.
Firefighters and police had to move people away from the area because the heat was so intense.
Hughes returned to the flats but the owner of the building was there and stopped him from entering. Hughes threatened to stab the man and shouted racial abuse at him.
The owner began to film Hughes on his mobile phone. Hughes exposed himself and said: “Make sure you get a good picture.”
Hughes, of Priory Road, Featherstone, pleaded guilty to arson, arson being reckless as to whether life was endangered, exposure and racially aggravated threatening behaviour. Christopher Morton, mitigating, said Hughes’s offending was linked to alcohol abuse.
A report into his offending assessed Hughes as posing a high risk of harming to members of the public in the future.
Hughes was told he must serve a four year custodial term followed by a further three years on licence.
He was also told he must go on the sex offenders register for seven years.