Witnesses could hear screaming from the upper floors as the flames rose and one desperate resident could be seen waving a white cloth.
Police said they were evacuating the block and “a number of people are being treated for a range of injuries” including two for smoke inhalation.
The fire brigade said 40 fire engines and 200 firefighters had been called to the blaze in Grenfell Tower, which has 120 flats.
“The fire is from 2nd to top floor of the 27 storey building,” the fire service said on Twitter.
“Firefighters wearing breathing apparatus are working extremely hard in very difficult conditions to tackle this fire,” London Fire Brigade assistant commissioner Dan Daly said.
“This is a large and very serious incident and we have deployed numerous resources and specialist appliances,” he said.
London mayor Sadiq Khan tweeted: “Major incident declared at Grenfell Tower”.
Actor and writer Tim Downie, who lives nearby, said: “It’s horrendous. The whole building is engulfed in flames. It’s gone. It’s just a matter of time before this building collapses.”
Police said in a statement they were called at 1:16am (7:16am Thai time) “to reports of a large fire at a block of flats in the Lancaster West Estate”.
The apartment block was built in 1974.
Local residents had warned a year ago about a potential fire risk caused by rubbish being allowed to accumulate during improvement works.
“This matter is of particular concern as there is only one entry and exit to Grenfell Tower during the improvement works,” read a blog post by the Greenfell Action Group.
“The potential for a fire to break out in the communal area on the walkway does not bear thinking about as residents would be trapped in the building with no way out,” it said.