Luke Gillard, 18, lit the aerosol spray with a lighter and pointed the shooting flame at the sleeping 16-year-old girl in January last year.
The youngster suffered a large burn to the inside of her leg and was forced to spend two nights at the Burns Observation Unit at St John’s hospital in Livingston.
The girl and a friend had been staying at Gillard’s home in Bonnyrigg, Midlothian, when she was horrifically burned by Gillard.
Join our Facebook group Our Edinburgh to share images and news from and around the Capital
The teenage girl, who cannot be named due to legal reasons, and her friend had gone to Gillard’s home to attend a house party but when they arrived at the house only Gillard and another male were in attendance.
All four had drunk vodka and cokes and listened to music before the victim later fell asleep on a couch within Gillard’s bedroom.
As she slept Gillard and the other male were said to be “carrying on” within the room with an aerosol and a lighter.
Gillard tried to “singe [his friend’s] hair” with the makeshift flamethrower but missed his target and instead burned the young girl on the leg.
The girl woke up due to the searing pain but all three within the room refused to tell her what had caused the six inch burn to her inner thigh.
The girl, now 16, didn’t tell her parents straight away but after visiting hospital she reported the incident to police.
Gillard pleaded guilty to culpable and recklessly spraying an aerosol can at the girl and using a lighter to ignite the flame causing severe injury and disfigurement to the girl at his home on January 27 last year when he appeared at Edinburgh Sheriff Court last month.
The teenager returned to court for sentencing on Friday where Sheriff Alistair Noble issued Gillard with a 220-hour unpaid work order.
Previously fiscal depute Nicole Lavelle told the court: “The group were having a good time socialising and listening to music. The complainer estimated she fell asleep between 3am and 4am.
“The girl’s friend said the accused was standing up in the room and both males were having a carry on with an aerosol and a lighter.
“The accused sprayed the can towards the other male’s feet not realising the complainer’s leg was there and lit the spray with the lighter.
“There was a small blast of flames and the accused hit the spray twice but only became aware he had burned the complainer’s leg when she woke up and said she was in pain.
“She woke up to the sound of laughter and a the sound of a can being put in a drawer. She had a hot burning sensation on the inside of her left leg.”
The group refused to divulge what had happened but when the girl left the home the following morning her friend told her she had been burned by Gillard.
The scared teen refused to tell her parents what had happened but due to the pain being “unbearable to sleep” with she opened up and told her grandmother about the incident.
She was eventually taken to Edinburgh Royal Infirmary for treatment but the wound had become infected and she had to be transferred to St John’s for further skin treatment. Police were soon informed.
Ms Lavelle said no plastic surgery was required and that the girl’s injuries had a 50 per cent chance of “healing completely within five to six years”.