Last month’s spectacular explosions at a large Philadelphia oil refinery complex injured five workers, terrorized city residents and drove up gasoline prices. But the impact could have been vastly worse had the explosions triggered a release from the refinery’s huge inventory of toxic hydrogen fluoride — up to 420,000 pounds’ worth , according to information the company filed with the Environmental Protection Agency in 2017. That disaster, had it occurred amid the chaos on the morning of June 21, would have imperiled hundreds of thousands of people living within a few miles of the plant.

The explosions occurred in the 149-year-old refinery’s alkylation unit, where hydrogen fluoride is used to convert butane and other chemicals into heavier hydrocarbons that raise the octane rating of gasoline. Of the nation’s approximately 135 oil refineries, only about 48 use hydrogen fluoride. Among refinery workers and safety experts, hydrogen fluoride-based alkylation commands the highest level of fear of any process used to make gasoline, and with good reason.

Hydrogen fluoride, also known as hydrofluoric acid, is a highly corrosive agent that requires specialized equipment and constant vigilance to prevent a release. Human exposure to just 170 parts per million in the air for 10 minutes can result in death or serious injury. Hydrogen fluoride binds to the calcium in human cells, causing severe, disfiguring chemical burns and compromising the heart, lungs and bones. Inhalation is rapidly fatal because of massive internal hemorrhaging and cardiac arrest.

In 2012, the release of a reported eight tons of hydrogen fluoride from a South Korean industrial plant sickened thousands of people in an agricultural area and left a disaster zone in its wake. Crops were destroyed and residents had to be relocated. Five plant workers died, and 18 others were severely injured. According to its 2017 filing with the E.P.A ., the Philadelphia refinery stores about 24 times the amount of hydrogen fluoride that was released in South Korea .