Fifteen fire engines and around 100 firefighters were sent to the scene in West Hampstead, north west London, just after 1am.
London Fire Brigade said the fire was believed to have started in a flat on the fourth floor of the five-floor building, although the cause is not clear.
Firefighters are still trying to get the flames under control, the brigade said just before 4am.
Photos on social media showed flames and thick smoke coming from the building, with the top floor appearing to have been taken over by the fire.
Station manager Clainton Murray said: “The fire is also affecting the roof and in the early stages was very visible for miles around.
“Firefighters assisted two people from the first floor and around 50 have evacuated the block.”
Angelica Malin, who lives nearby, said on Twitter that the fire appeared to have caused a “huge amount of damage and had spread dramatically”.
A local pub, The Black Lion, tweeted: “Anybody affected by the current fire in West Hampstead our doors are open…We will be here all night”.
The block is understood to be Welbeck Mansions which, according to a local estate agent, was built in 1897.