A man stood outside laughing and taking selfies as fire crews battled a blaze he had started at his flat.
Freddie Pritchard lit a cigarette on his bed along with aerosol canisters and vapes before leaving the room.
Three other flats and commercial units below had to be evacuated as thick smoke billowed from the building.
Pritchard initially claimed the blaze on May 27 this year had been caused by a faulty phone charger.
But, the 29 year-old – a convicted sex offender – pleaded guilty to wilful-fire-raising as he appeared in the dock at the High Court in Glasgow.
He will be sentenced next month.
Pritchard had been living at the council-flat in Main Street, Ayr having been freed from prison on March 1 2024.
One of the other tenants at the block returned home shortly after the blaze was started.
He initially heard an alarm in Pritchard’s home before, around ten minutes later, noticing flames and a large plume of black smoke emerging from the flat below into his.
The neighbour was in a “panic” and feared he would not be able to get his cats out in time.
The fire brigade then arrived and the man with his pets were helped out the smoke-filled building.
Prosecutor BJ Gill said Pritchard had taken “no action” to alert his neighbours to what had happened.
The court heard a total of ten fire officers took two hours to quell the blaze.
Pritchard stood out in the street with one of the other tenants at the time.
He claimed he had come home from hospital and that his phone charger had “caught fire”.
Mr Gill told the hearing: “While he was waiting in the street, Pritchard was acting in a light-hearted manner.
“He was taking selfies and photos of the fire engines. He was phoning friends as well as laughing and joking.”
A probe later concluded the fire was deliberate.
Days later, Pritchard admitted to witnesses he had used a cigarette to start the blaze, but had “not expected it to take hold the way it had”.
He claimed his aim was either to be charged or to return home to live with his parents.
South Ayrshire Council estimated the repair bill to be between £25,000-£30,000.
No-one was fortunately hurt by what happened.
Lord Young remanded Pritchard in custody as sentencing was adjourned until December 10 in Edinburgh.
Follow STV News on WhatsApp
Scan the QR code on your mobile device for all the latest news from around the country