A block of flats was evacuated after a fire at a storage depot in Neath early on Saturday.
Ten residents were moved at 0500 BST while 50 fire-fighters, using an aerial platform, tackled the blaze at Amey Construction in Windsor Road.
Mid and West Wales Fire and Rescue Service said six fire crews managed to stop flames spreading to the flats.
The residents were taken to a community centre during the emergency.
The fire broke out in the building next to the railway line at 0440 BST.
Terraced homes were also close to the scene of the blaze.
Resident George Austin-Eames said his wife had woken and smelt smoke and they took their children to neighbours.
"It was all black smoke, billowing out - it was horrendous" he said.
"The priority with something like that is to get any kids out."