VANDALS are thought to have started a fire that burned through the floor of an unoccupied mill and came close to destroying the £6.4m building.
Firefighters said closed internal doors at Acre Mills in Lindley kept the blaze from spreading from the ground floor room where it started.
The mill, on Acre Street opposite Huddersfield Royal Infirmary, was bought by health chiefs in a £6.4m deal earlier this year.
It was previously used by wire manufacturer Joseph Sykes Bros.
The fire been burning for some time and was discovered by security guards on Saturday afternoon.
Huddersfield firefighters were called out at 1.15pm and spent 90 minutes dousing the blaze.
The fire was started on the ground floor in a room previously used as office accommodation.
Interior doors in the building were closed, which restricted the blaze to the one room.
Lee Benson, sub-officer at Huddersfield Fire Station, said: "It could have been quite serious, if the fire had not been confined to one room.
"It looks like youths broke in and started the fire.
"It was burning for a long time and got very hot. The windows were smashed by the heat."
The room was gutted with the floor burned away.
Firefighters in breathing apparatus tackled the fire and smoke was extracted with a ventilation unit.
It is thought that the fire may have been started late on Friday night or early on Saturday morning in waste cardboard.
Youths were said to have been seen on the roof earlier. Police and forensics experts are investigating.
The 300,000sq ft premises were acquired by the Calderdale and Huddersfield NHS Trust in April to expand services and car parking in Lindley.
Steve Bannister, the associate director of operations and facilities for Calderdale and Huddersfield The NHS Trust said that the incident would have no effect on development work which was being done.