Up to 100 people were evacuated from their homes, and train services were disrupted, during a fire at a plastics factory in Mansfield, Notts.
The fire started in machinery
The fire at Pyramid Products also stopped the Carling Cup match between Mansfield Town and Preston North End.
More than 60 firefighters tackled the fire, which began at around 1300 BST on Tuesday and continued overnight.
Nearby roads were cordoned off by police, as there were concerns the building could collapse.
Other people living close to the fire were told to stay inside and keep windows and doors closed.
Nobody was seriously hurt, but a number of people were treated for breathing in smoke.
Firefighters remained at the scene throughout the night, monitoring the shell of the building.
Structural engineers examined the building on Wednesday and decided it will have to be demolished.
A Nottinghamshire fire service spokesman said earlier that there was no indication the fire was started deliberately.
People were treated after breathing in smoke
No trains were being allowed to pass along the track through Mansfield because of the smoke.
Buses ferried passengers between Kirkby-in-Ashfield and Mansfield Woodhouse.
Eight fire engines were sent to the scene, and eyewitnesses said the smoke could be seen from up to two miles away.
Lesley Charlton and Colin Lambert were among those who had to leave their homes.
Ms Charlton told the BBC: "There was about 17 fire engines...police came knocking on the door and said we've got to go to Sutton Road.
"You could see flames on the top floor, you could see thick grey smoke coming out."
Mr Lambert said: "At first I thought it was a big black cloud and I said to one of my work friends 'I think it's going to rain', then I realised it was actually smoke."
It is thought the fire started in some machinery.
Station Officer Glenn Mears said crews are putting water in through the roof which has collapsed.
He said: "We've had a period throughout the night where we've allowed areas of fire to hopefully burn out.
"We are aware of the contents of the building and we see no immediate danger."
Trains on the Robin Hood Line are running to timetable, but Mansfield town station is still closed as a precaution.
Passengers are advised to use Mansfield Woodhouse station instead.
Ged Burgess from Central Trains said: "We're running trains but you'll have to get on at Sutton Parkway or Mansfield Woodhouse.
"We have no estimate to when we can restore Mansfield town station, but we're waiting to see.
"Obviously with a situation like this the primary concern is safety and if people's journeys have been inconvenienced, then I hope they'll understand it is for the best of reasons."