Eight fire engines and around 60 firefighters were called to reports of a chemical incident at a block of flats on Landridge Road in Fulham.
Several people were treated by London Ambulance Service crews at the scene and taken to hospital.
Crews wearing breathing apparatus helped residents in the block to evacuate their properties.
Firefighters carried out a final monitoring sweep of the building and found no elevated readings, allowing residents to return to their properties.
Station Commander Graham Crow was at the scene, he said: "This was a protracted incident with crews remaining on scene for several hours. Motorists were advised to avoid the area due to a cordon put in place around the property."
The Brigade was called at 0035 and the incident was over by 0556. Fire crews from Fulham, Wandsworth, Euston, Bethnal Green, Hammersmith, Kensington, Battersea and Chiswick fire stations were at the scene.