Firefighters had to smash down doors in a block to flats to help evacuate the building as a blaze broke out shortly before midnight.
Six crews tackled the fire at the Wheatcroft complex on Hanover Street, Batley, after several residents dialled 999 last night (Sunday).
The blaze in the three storey block of flats is thought to have started outside.
Investigators are looking into the possibility that it may have begun near or in a bin shoot within the building.
Firefighters searched a number of flats after reports that there were people still inside and four people were rescued.
Dewsbury watch commander Jimmy Johnston was not on call at the time but said: “There was quite an intense fire and smoke logged the whole of the building.
“The crews had to evacuate some of the flats and break into some of them to make sure there was nobody left in the building.
“Everybody seemed to get out okay but there were some with the ambulance so they may have suffered some smoke inhalation.
“There are a lot of in-shoots in the building so that is one of the things they are looking at.”
The pumps, which came from Dewsbury, Cleckheaton, Morley, Ossett and Hunslet, spent more than two-and-a-half-hours at the scene.