A 30-year-old man almost died after becoming trapped by the foot for two nights inside a Tayside factory.
Emergency service workers rescued the man from the window of the J&D Wilkie factory after staff became aware of an intruder inside the premises.
One worker said the man’s shoes had got stuck in the window, trapping him there from Friday night until Sunday evening.
Staff had initially heard “whimpering” on Saturday but had been unable to locate the source of the noise, they added.
It was claimed a manager checked the area again on Sunday afternoon, discovering the man at around 6pm before contacting the emergency services.
It is understood the man was in a very poor condition when discovered.
Friends and family had been searching for the man from his disappearance on Friday night and issued frantic appeals for help on social media.
Firefighters rescued him from the window before giving him oxygen therapy and passing him to ambulance staff.
Oxygen therapy is used when levels in the blood have become dangerously low.
The man was taken to Ninewells Hospital and treated for a serious leg injury. His condition was initially critical but is now believed to have stabilised.
Residents in the Angus town had become alarmed after police closed Marywell Brae, near the factory, as emergency service workers gathered at the scene.
It was not immediately clear what the rescued man was doing in the factory building or how he had become seriously hurt.
Police Scotland confirmed they had charged a man with attempted house breaking.
A spokesman said: “Police Scotland can confirm a 30-year-old man has been charged in connection with an attempted housebreaking at a factory on Marywell Brae in Kirriemuir on Sunday, 23 November.
“A report will be submitted to the Procurator Fiscal.”
A Scottish Fire and Rescue spokeswoman said firefighters had assisted ambulance staff with a male casualty.
She said: “We received the call at 17:58 and sent one appliance to the scene. We deployed a 13.5 metre ladder in the rescue, gave the casualty oxygen therapy, before handing him to the Scottish ambulance service.”
Jean-Christophe Granier, J&D Wilkie, joint managing director, said he could not comment for legal reasons.
Headquartered in Kirriemuir, the textile company has manufacturing facilities in Scotland, China and India and is one the area’s main local employers.