RESIDENTS of Los Taques, on the west coast of Venezuela’s Paraguaná peninsula, have long lived in the shadow of the world’s second-biggest oil refinery. Breeze-block homes back directly onto the refinery’s tank farm. Many locals say that for several days in late August they noticed an unusual smell. It was “like a gas or something, it hurt the nostrils and made us feel dizzy”, said one, Ramón Salas. Shortly after 1am on August 25th he was woken by a huge explosion. The blast ripped off much of the roof of his home and blew out the windows.

At least 42 people were killed and almost 100 injured. Over 200 homes and a dozen businesses were severely damaged or destroyed. The barracks of the national guard troops charged with perimeter security was levelled, killing at least 20 soldiers. So was a small plant bottling lubricating oil. It was the worst disaster in the history of Petróleos de Venezuela (PDVSA), the state oil monopoly, and one of the worst refinery explosions ever. Firefighters took more than three days to extinguish the blaze from storage tanks ignited by the blast.

In the charged atmosphere six weeks before a presidential election, recriminations were quick to follow. Rafael Ramírez, who is both oil minister and PDVSA’s chairman, blamed a gas leak. Hugo Chávez, who is seeking a third consecutive six-year term, visited the scene and expressed sympathy for the victims. But he lashed out at critics who claimed that negligence was to blame. Pro-Chávez media commentators alleged sabotage, planned by the opposition.

Henrique Capriles, the opposition candidate, offered support for the victims and called for unity. He also demanded an inquiry, free from “politicking”. The Communist Party, a Chávez ally, said union delegates should participate in the investigation. Iván Freites, who leads the local oil workers’ union, said the disaster could have been avoided: he said the union had complained of damaged equipment, leaks and lack of repairs.

Mr Ramírez, who has run PDVSA since 2004, is one of Mr Chávez’s top aides and was recently confirmed in his post “for the next six years”. He has boasted of employing only chavistas. On his watch, investment and maintenance have taken second place to the government’s appetite for oil revenue. Last year PDVSA paid around $19 billion in tax, royalties and dividends. It forked out twice as much to opaque funds run directly by the president, and to welfare programmes. Despite high oil prices, PDVSA’s debt has risen to over $40 billion. In an earlier statement to parliament, Mr Ramírez admitted that much essential maintenance had been postponed “owing to lack of parts”.

The refinery disaster follows a gun battle inside Yare prison on August 19th that left at least 26 inmates dead, and the collapse four days earlier of a bridge linking Caracas with eastern Venezuela. Will all this affect the election? Some polls continue to show the president with a double-digit lead, but others make the race closer. What is clear is that Mr Capriles is gaining ground, and the blast will not help Mr Chávez.