BAY POINT, California (AP) — A fire that ignited in an underground natural gas storage area in the San Francisco Bay Area prompted officials to evacuate thousands of residents, and Chevron emergency crews were working Thursday to purge gas from a pipeline to prevent an explosion.

Officials issued evacuation orders late Wednesday night for about 4,000 people from 1,400 homes near the pipeline in the city of Bay Point, California, after the fire started.

Chevron spokesman Cary Wages told reporters Thursday that workers spent the night purging natural gas from the pipeline and planned to inject nitrogen “which will extinguish the fire” burning in the underground vault.

Contra Costa County assistant fire chief Terence Carey said that a grass fire started Wednesday night at about 6 p.m. near the pipeline, which crews quickly extinguished. About an hour later, a second fire was reported in the nearby underground vault that serves as a storage unit for the pipeline, he said.

“It was realized very quickly that there was a high probability of danger,” Carey said, which prompted the evacuation order for homes within a half-mile (0.8 kilometer) radius of the pipeline. Officials went door to door to tell people to leave their homes.

KTVU-TV reported that many people slept in their parked cars at a BART light rail station and others parked and slept in outdoor parking lots. Evacuation centers were opened Thursday morning.

Officials said Thursday they hoped to start allowing people return home within hours, after the fire is extinguished.