Sheffield Crown Court heard how just after 3am on February 12 this year, South Yorkshire Fire and Rescue were called out to reports of a blaze.
Prosecuting, Rosemary Kavanagh, told the court how the emergency services were alerted to the blaze when Neil McKenna, of Lowedges Crescent, Lowedges called them to say his first-floor flat was on fire.
"He had effectively barricaded himself in the bathroom. There were five other flats in the building," said Ms Kavanagh.
She added: "When the fire service attended they could see smoke coming from the inside of the front room."
McKenna, aged 50, was taken to hospital to be treated for smoke inhalation.
Ms Kavanagh told the court that when he was later interviewed by the police, McKenna later told them that he was cleaning his trainers with some white spirit while he was smoking.
McKenna told police it was as a result of him smoking while he was applying white spirit that he had accidentally started the fire.
This explanation was accepted by presiding judge, Judge Robert Moore, at an earlier hearing, and McKenna pleaded guilty to one count of arson being reckless as to whether life would be endangered on this basis at a plea and trial preparation hearing.
Ms Kavanagh told the court that an investigation into the fire, which caused approximately £9,000 of damage, showed that the accelerant had been found in three different sites in the flat.
McKenna's barrister, Andrew Jepson, said that while white spirit may have been found at three different sites in the flat, all three of the sites were located on his bed.
In mitigation, Mr Jepson told the court: "He lost his job, he then lost his wife - she effectively left him - and this meant the loss of all contact with his children. He found himself living in a less than salubrious flat, completely alone and completely isolated."
Mr Jepson said this led to McKenna turning to drink and attempting to harm himself.
Sentencing McKenna to three years in prison for the offence, Judge Moore noted that it had taken place while McKenna was 'in drink' and 'at a very low point' in his life.