A huge explosion rocked Venezuela's biggest oil refinery and unleashed a ferocious fire Saturday, killing at least 39 people and injuring more than 80 others in the deadliest disaster in memory for the country's key oil industry.

Balls of fire rose over the Amuay refinery, one of the largest in the world, in video posted on the Internet by people who were nearby at the time. Government officials pledged to restart the refinery within two days and said the country has plenty of fuel supplies on hand to meet its domestic needs as well as its export commitments.

At least 86 people were injured, nine of them seriously, Health Minister Eugenia Sader said at a hospital where the wounded were taken. She said 77 people suffered light injuries and were released from the hospital.

si-refinery-smoke-03159779

Oil Minister Rafael Ramirez said the refinery could restart operations in two days. (Abisaid Cermeno/Associated Press)

President Hugo Chavez declared three days of mourning in the country.

"This affects all of us," Chavez said by phone on state television. "It's very sad, very painful."

Chavez said he ordered a "deep investigation" to determine what caused the explosion.

Vice President Elias Jaua, who traveled to the area in western Venezuela said on state television late Saturday that at least 39 people were killed by the explosion, up from the earlier death toll of 26. Jaua also said that authorities tried "to save the greatest number of lives."

Officials said firefighters had controlled the flames at the refinery on the Paraguana Peninsula, where clouds of dark smoke were still billowing at noon.

Oil Minister Rafael Ramirez said the state oil company should be able to "restart operations in a maximum of two days."

"We have sufficient supplies... in the entire country, and our production at the maximum to deal with any situation in our domestic market," Ramirez said. "In that sense, we won't have major effects."

'Blast wave was of a significant magnitude'

An official of the state oil company, Petroleos de Venezuela SA, said the country also has enough supplies on hand to guarantee its international supply commitments. The official spoke on condition of anonymity because he wasn't authorized to speak publicly about the matter.

The blast occurred about 1:15 a.m. when a gas leak created a cloud that ignited, Ramirez said. An adjacent National Guard post was severely damaged by the blast, along with nearby homes, he said.

"That gas generated a cloud that later exploded and has caused fires in at least two tanks of the refinery and surrounding areas," Ramirez said. "The blast wave was of a significant magnitude."

The explosion shattered walls of nearby shops, ripped out windows from homes and left the surrounding streets covered with rubble and twisted scraps of metal.

In a neighbourhood next to the refinery, shopkeeper Yolimar Romero said she was at her computer when a shock wave swept over the area shortly after 1 a.m.

"At that instant, the whole house shook as if it were an earthquake," she said.

"The windows went flying off with their frames and everything."

Electricity was knocked out, leaving Romero in the dark and her house filled with smoke. She found a flashlight and started looking for her husband and three children.

Outside on the street, the family saw scattered hunks of brick walls and ruins of a National Guard post and about 20 other homes. Bodies were being pulled from buildings down the street.

Officials said those killed included a 10-year-old boy, and that 17 of the 26 victims were National Guard troops stationed at a post next to the refinery.

Images in the early hours after the explosion showed the flames casting an orange glow against the night sky. One photograph showed an injured man being wheeled away on a stretcher.

si-venezuela-oil-refinery03

An injured oil worker sits in a wheelchair at a hospital in Punto Fijo on Saturday. (Diario EL Amanecer/Associated Press)

"The areas that had to be evacuated were evacuated," Falcon state Gov. Stella Lugo said on television, according to the state-run Venezuelan News Agency. "The situation is controlled. Of course there's still a fire rising very high, but ... the specialists tell me there is no risk of another explosion."

Ramirez said a panel of investigators was being formed to investigate the cause of the gas leak. A prosecutor also was appointed to lead the investigation. Troops were deployed to the area.

Ramirez said that nine storage tanks were damaged. He said supplies of fuel had been cut off to part of the refinery, and that the fire had been brought under control, though the flames continued to burn up fuel in some of the tanks.

Firefighters were using foam to extinguish the flames in one of the remaining tanks, Ramirez said.

"This regrettable and sad event is controlled, is under control," Ramirez said on television, while plumes of smoke continued to rise from the refinery.

Major supplier to U.S.

Amuay is part of the Paraguana Refinery Complex, which also includes the adjacent Cardon refinery. Together, the two refineries process about 900,000 barrels of crude per day and 200,000 barrels of gasoline. Venezuela is a major supplier of oil to the U.S. and a member of the Organization of Petroleum Exporting Countries.

While the cause of Saturday's disaster remained unclear, some critics of President Hugo Chavez's government have recently pointed to increasing numbers of smaller accidents and spills as an indication of problems within the state-run company known as PDVSA.

"This tragedy is probably the worst one the oil industry has had in many years. Accidents happen, of course, although the problem with PDVSA is the inordinate amount of accidents that have taken place during the last years," said Gustavo Coronel, an energy consultant and former executive of PDVSA. Considering that record overall, Coronel said, "we are not talking about bad luck but about lack of maintenance and inept management."

On Saturday morning, Ramirez said the explosion occurred in an area of the refinery where storage tanks are located. On television, he showed an aerial map of the rows of tanks where the flames raged.

"All of the events happened very quickly," he said. "When we got here in the middle of the night, at 3 or 3:30 in the morning, the fire was at its peak."