Heavy machinery pulled vehicles from huge trenches gouged by explosions along an underground pipeline in Taiwan's second-largest city that killed at least 25 people and injured 267.

The series of five explosions from about midnight Thursday to early Friday struck a densely populated industrial district in the port of Kaohsiung where petrochemical companies operate pipelines alongside the sewer system under city streets. The cause of the disaster was being investigated.

Four firefighters were among the victims when the blasts went off hours after they'd been called to investigate gas leaks. At least six fire trucks were flung into the rubble. The blasts sent flames shooting into the sky and hurled concrete and cars through the air, leaving meter (yard) -deep trenches down the middle of several roads.

Three people remained missing and many of the injured were still receiving emergency treatment. The disaster was Taiwan's second in as many weeks following the crash of a TransAsia Airways prop jet on the island of Penghu on July 23 that killed 48 people and injured 10.

"Last night around midnight, the house started shaking and I thought it was a huge earthquake, but when I opened the door, I saw white smoke all over and smelled gas," said Chen Qing-tao, 38, who lives 10 buildings away from the main explosion site.

The explosions were believed caused by leaking propene, a petrochemical material not intended for public use, said Chang Jia-juch, director of the Central Disaster Emergency Operation Center. Chang said the cause and location of the leaks were unknown.

The exploded gas line belongs to government-owned CPC Corp., which told The Associated Press there were no signs of problems before the explosions.

Video from broadcasters showed residents searching for victims overnight in shattered storefronts and rescuers placing injured people on stretchers, while passersby helped other victims on a sidewalk. Numerous fires sent smoke pouring into the night sky above the Chian-Chen district, where factories operate near residential buildings.

The government's disaster response center said it was trying to prevent secondary explosions. Some fires burned into midday Friday.

"In terms of what we can prevent, we're afraid another explosion could happen, as there is that possibility," said Hsu Lee-hao, a Ministry of Economic Affairs section chief staffing the disaster response center.

Many of the dead and injured had been outside near a night market and were hit by flying rubble or cars, a police officer at the scene said. Police and firefighters suffered burns while trying to control blazes.

Area resident Chang Bi-chu, 63, described seeing dead bodies along the roadside. "I felt really bad. After all there just was the air crash in Penghu last week."

Chang said the front door of her home was warped by the explosion and power was cut, leaving the house without lights or fans in the steamy weather.

"We don't have money to stay in a hotel and they're all booked anyway," she said.

Power supplies to 12,000 people in the area were severed, and 23,600 lost gas service. More than 1,100 people were evacuated overnight and the worst-affected areas were sealed off.

Chen Chu, mayor of the southwestern port city of 2.8 million people, warned people to stay away from the area and said the city had opened nine emergency shelters.

Backhoes pulled upended fire trucks and other vehicles from the rubble. Paramedics with rescue dogs combed the neighborhood for survivors.

Rescuers expected to find few, if any, people in the rubble because no buildings collapsed, the economics ministry's Hsu said.

Police officers and firefighters had investigated a gas leak on Kaixuan Road reported at 8:46 p.m. Thursday, but were unable to identify the source. They were closest to the fire during the initial midnight explosion, and many suffered burns.

Large trenches ran down the center of four of the hardest-hit roads, edged with pavement slabs torn apart by the blasts. Burned walls and toppled shop signs lined Sanduo Road, near an elementary school.

Taiwanese Premier Jiang Yi-huah announced that all flags would fly at half-staff for three days from Aug. 5 in honor of the victims of both the Penghu air crash and Kaohsiung explosion.

Much of the drama was captured on closed-circuit television, dashboard cameras and cellphones.

A video showed an explosion rippling through the floor of a motorcycle parking area, hurling concrete and other debris through the air. Cellphone video captured the sound of an explosion as flames leapt at least 9 meters (30 feet) into the air.

One witness said he tried to help before paramedics arrived.

"I was on my scooter just across the street, suddenly there was the explosion, a white car was blown toward me, and I saw the driver trapped in the car," said Wong Zhen-yao, 49, owner of a car repair shop in the disaster area.

"There was still fire nearby. I tried to pull the guy out but couldn't," he said. "Only after the smoke was gone did I realize there was such a big hole in the middle of the road."