A massive explosion tore through Venezuela's largest refinery on Saturday, killing at least 24 people and wounding more than 50 in South America's largest oil producer, officials said.

Vice President Elias Jaua said most of the dead were members of the country's National Guard who were protecting the refining facility in the town of Amuay, located on the Paraguana Peninsula in the northwest.

Another 56 people were wounded, he said, updating an earlier toll. Of those, four remained in hospital in critical condition, while two were transferred to a neighboring state and the remainder discharged.

Falcon State Governor Stella Lugo had earlier told state television that one of those killed was a 10-year-old child.

Energy Minister Rafael Ramirez said the blast was sparked by a gas leak, the cause of which remained to be determined.

"The gas cloud exploded, igniting at least two storage tanks and other facilities at the refinery," he said.

Ramirez said the explosion was powerful and caused "significant damage" not only to the plant, but also to nearby shops and homes.

"There is significant damage to the infrastructure and houses that stood in front of the refinery," the minister told state-controlled VTV television.

Later in the morning, firefighters were able to bring the fire under control, officials said.

Smoke was still billowing from the facility, but Lugo said there was no risk of another blast.

Jaua took to Twitter shortly after the explosion, writing that the "damage was significant" and that additional ambulances and medics had been deployed to the scene, as well as Venezuelan armed forces.

Before the blast, the Amuay refinery, one of the biggest in the world, was able to process about 645,000 barrels of crude a day.

Venezuela produces about three million barrels of oil per day (mbd), according to state figures, while the Organization of the Petroleum Exporting Countries (OPEC) puts the number at 2.3 mbd.

OPEC certified in 2011 that Venezuela has the largest oil reserves in the world at 296.5 billion barrels, surpassing Saudi Arabia, the country with the largest refining capacity.

In March, Venezuelan authorities reported even higher reserves, of 297,570 billion.

The country is currently preparing for October 7 elections, in which President Hugo Chavez -- Latin America's most influential and outspoken leftist leader for more than a decade -- is seeking a third term.

Opposition candidate Henrique Capriles, the youthful former governor of Miranda state, has trailed Chavez in recent polls by some 15 percentage points.

If Chavez, who has declared himself "free" of the cancer he was diagnosed with over a year ago, wins and serves out his full term, he could rack up 20 years in office.