Around 70 firefighters took nearly four hours to bring a warehouse inferno under control.
The blaze, which gutted Greenhill Mills in Grange Road, Batley , broke out at around 11.30am on Thursday.
Workers at a rag sorting firm are believed to have escaped unhurt. The cause of the fire is thought to have been accidental.
Firefighters from Dewsbury , Mirfield, Cleckheaton, Leeds, Morley, Ossett, Wakefield and Hunslet tackled the fire as it tore through the three-storey building.
Fire commanders ordered in backup from other stations as the fire – accelerated by clothes and rags on the premises – grew in size and ferocity.
Explosions – thought to be gas cylinders – were also reported.
The warehouse and homes surrounding the premises were evacuated while firefighters equipped with breathing apparatus and aerial jets fought the fire.
At around 3.20pm West Yorkshire Fire Service (WYFS) reported that the blaze was under control – but crews continued to damp down the remaining blaze well into Thursday night.
READ MORE: Cyclist dies in Brighouse road tragedy
Operation commander, Richard Hall, said that textiles in the factory had enabled the blaze to spread rapidly.
He said: “We got the call just before midday. Initially the turnout was from Dewsbury with four fire engines.
“Then we requested support due to the mill storing a high amount of textile materials which were highly combustible and burn readily.
“Initially the fire was at the front and the rear of the premises but it quickly developed and became 100% involved in a very short period of time.
“We requested 10 fire engines and two aerial appliances and surrounded the building to stop it spreading further.
“So we have had fire crews from across West Yorkshire including Kirklees and Leeds – that’s around 70-plus fire-fighting personnel.
“People were evacuated from up to 20 houses opposite and all the surrounding factories which had people in them.
“The mill owner was here at the time and confirmed that no-one was in the building and all persons had been evacuated.
“The crews have worked really well and we have brought some special appliances in.”
Mr Hall added: “It’s taken several hours to get it under control. It was a very serious fire due to the high amount of combustible materials inside it.”
Fire crews had several problems dealing with the blaze. They struggled to find enough water in nearby hydrants and a strong wind fanned the flames.
Fire service area manager Nick Smith praised the fire crews involved.
He said: “Firefighters worked in very difficult, windy conditions to prevent the very real danger of the fire spreading to neighbouring buildings.
“The mill was also at risk of collapse, which posed further difficulties to firefighter safety.
“It was a tremendous effort from all firefighters, who made the lives of nearby people their priority, and I applaud their quick thinking and hard work.”