At least 260 firefighters and 52 fire engines were struggling to contain the blaze in the nearby neighborhood, fire officials said.
Video of the fire broadcast on television showed hundreds of people in the community running in panic while thick plumes of black smoke and orange flames filled the sky and firefighters battled the blaze.
A preliminary investigation showed the fire broke out when a pipeline ruptured during heavy rain, possibly from a lightning strike, said Eko Kristiawan, Pertamina’s area manager.
He said the fire would not disrupt the country’s fuel supply.
Satriadi Gunawan, who heads Jakarta’s fire and rescue department, said people living in the residential area were still being evacuated and were being taken to a nearby village hall and a mosque.
“The fire caused several explosions and quickly spread to residential houses,” Gunawan said.
He said at least 17 people were dead, including two children, and 50 had been hospitalized, some with severe burns.
Indonesia’s minister of State-Owned Enterprises, Erick Thohir, expressed his condolences to the victims and their families and ordered Pertamina to thoroughly investigate the fire and focus on quickly assisting the community.
“There must be an operational evaluation in the future. I’ll continue to monitor this case,” Thohir said in a video statement.