The blast next to an oil pipeline destroyed buildings, lorries and cars as it tore through a residential area of the sprawling megacity on Sunday.
"17 bodies have so far been recovered from the rubble while 25 injured people are being treated for injuries at the site," the Lagos state government wrote on Twitter.
The toll was an increase on the figure of 15 given by the authorities on Sunday.
The Lagos state government said workers from all its rescue and recovery agencies were "still clearing the debris of the incident".
"Efforts are on to determine the cause of the explosion that has left many homeless," it said.
The incident happened at around 8:00 am (0700 GMT) on Sunday and destroyed around 50 buildings in the residential district of Abule Ado.
The state-owned Nigerian National Petroleum Corporation (NNPC) said preliminary indications showed the initial blast was caused by a truck that "hit gas bottles stacked up in a gas processing plant".
"The impact of the explosion was so huge that it led to the collapse of nearby houses and damage to an NNPC pipeline," the company added.
Managing Director Mele Kyari said a fire spewing from the pipeline was put out late Sunday and maintenance crews were working to fix the damaged section.
Lagos state government said "secondary explosions occurred at the location of the fire and caused significant damage to multiple buildings", razing a church and hitting the dormitory of a girls' school.
Pipeline and tanker truck explosions are common in Nigeria, where most people live in poverty even though the country is the biggest producer of oil on the continent, with around two million barrels per day.
Some incidents happen when residents try to siphon off oil or petrol from pipelines or when tanker drivers have accidents on the country's ill-maintained roads.
Related Story