Many others were injured in the blast in the heart of the business district, which appears to have centred on a four-storey complex of shops and homes, flanked by local banks.
"
There are over 30 bodies in the mortuary and there could still be many more dead in the debris
"
Lagos State Governor Bola Tinubu
The police said there were no indications that the blast at 1130GMT was the result of anything other than an accident, but they are still investigating.
There had been some local speculation that it might have been caused by a bomb.
The force of the blast, which could be heard kilometres (miles) away, ripped the facade off the shopping complex, while one of the adjoining buildings almost totally collapsed.
Huge crowds gathered at the scene, hampering access for the police and emergency services.
Heavy lifting gear was taken in to lift slabs of concrete in the hope of finding survivors trapped under the rubble.
Chaos
"There are over 20 bodies in the mortuary and there could still be many more dead in the debris," Lagos State Governor Bola Tinubu told journalists at the site of the blast.
The BBC's Dan Isaacs said the scene was one of utter confusion, with looters taking away computer equipment and other valuables from the shops and banks.
Police responded by firing in the air to warn off looters, and beating anyone who came too close, our correspondent says.
According to local residents, some of the victims were in other blocks, away from the building which bore the brunt of the blast.
"My uncle was in the balcony of our house talking with a friend and the force of the explosion threw them down," Remi Oyebanji told the Associated Press.
"They're both dead."
Only last week, Nigerians commemorated the first anniversary of a huge explosion at an arms depot in Lagos in which more than 1,000 people were killed.
Most of the victims drowned in a canal after being trampled underfoot in a stampede of people fleeing the explosion.