The series of explosions about midnight Thursday and early Friday struck a district where several petrochemical plans operate pipelines alongside the sewer system in Kaohsiung, a southwestern port with 2.8 million people.
The fires were believed caused by a leak of propene, a petrochemical material not intended for public use, but the source of the gas was not immediately clear, officials said.
Video from the TVBS broadcaster showed residents searching for victims in shattered storefronts and rescuers pulling injured people from the rubble of a road and placing them on stretchers while passersby helped other victims on a sidewalk. Broadcaster ETTV showed rows of large fires sending smoke into the night sky.
Four firefighters were among the 24 dead and 271 people were injured, the National Fire Agency said. The firefighters had been at the scene investigating reports of a gas leak when the explosions occurred, Taiwan's Central News Agency reported.
At least five blasts shook the city, Taiwan's Premier Jiang Yi-huah said.
Chang Jia-juch, the director of the Central Disaster Emergency Operation Center, said the leaking gas was most likely to be propene, meaning that the resulting fires could not be extinguished by water. He said emergency workers would have to wait until the gas is burnt away.
The source of the leak was unknown. Chang said, however, that propene was not for public use, and that it was a petrochemical material.
Kaohsiung Mayor Chen Chu said several petrochemical companies have pipelines built along the sewage system in Chian-Chen district, which has both factories and residential buildings.
"Our priority is to save people now. We ask citizens living along the pipelines to evacuate," Chen told TVBS television.
Power was cut off in the area, making it difficult for firefighters to search for others who might be buried in rubble.
CNA said the local fire department received reports from residents of gas leakage at about 8:46 p.m. and that explosions started around midnight.
Closed-circuit television showed an explosion rippling through the floor of a motorcycle parking area, hurling concrete and other debris through the air. Mobile phone video captured the sound of an explosion as flames leapt at least 30 feet (9 meters) into the air.
One of the explosions left a large trench running down the center of a road, edged with piles of concrete slabs torn apart by the force of the blast. A damaged motorcycle lay in the crater, and TVBS showed cars flipped over. The force of the initial blast also felled trees lining the street.
Associated Press writers Gillian Wong and Ian Mader in Beijing contributed.