Residents had to be rescued from a smoke-filled block of flats after a man deliberately set fire to his home.
John Evans torched the flat after going to a housing office and declaring himself homeless, Hamilton Sheriff Court heard this week.
Evans, 33, admitted wilful fireraising in George Court, Hamilton, on June 17, 2019.
Alan McDonald, prosecuting, said Evans had contacted South Lanarkshire Council three days earlier to complain about "violence from a neighbour" and seek new accommodation.
On the morning of the fire he went to a housing office in Hamilton but was asked to return at 2pm.
Mr McDonald told the court: "Around 11.30am the accused was seen by a neighbour in George Court.
"Ten minutes later the smoke alarm in the accused's flat could be heard.
"Two British Transport Police officers were on patrol and noted thick smoke coming from the first floor flat.
"There are 11 flats in the block. A number of residents were unable to get out of their flats because of the amount of smoke.
"One person went on to a narrow ledge outside his flat and two others were seen hanging out of windows, trying to get air.
"Fortunately, firefighters were able to rescue everyone. One man was taken to hospital suffering from smoke inhalation, but he was released the same day."
The court heard that Evans turned up as scheduled for his 2pm appointment at the housing office.
He was arrested and denied starting the fire. However, forensic analysis of his hands and clothing linked him to it.
Sheriff Liam Murphy deferred sentence until August for background reports.
Evans, now of Park Crescent, Strathaven, had his bail continued.
Defence agent Andy Thomson said his client hasn't been in trouble since 2019.
*Don't miss the latest headlines from around Lanarkshire. Sign up to our newsletters here.
And did you know Lanarkshire Live had its own app? Download yours for free here.