Exxon confirmed that there had been an "incident" at the refinery but it did not offer further details. It said emergency procedures had been activated to address the situation, and employees were working with the appropriate agencies. Four contractors were taken to a local hospital for evaluation for minor injuries, Exxon said in a statement.
The Division of Occupational Safety and Health, commonly refereed to as Cal/OSHA, is investigating the blast and said it was too early to determine the cause. The agency has issued a temporary order prohibiting work at the unit until inspectors could determine the cause of the explosion, according to NBC News.
The refinery, which employs some 650 employees and uses 550 contractors, produces a specially formulated low-emissions gas that's sold in Southern California, Arizona and Nevada. The site produces nearly 10 percent of all gasoline sold in California, according to Exxon.
Read MoreOil prices rising? Soros makes big bet on energy
The price of March-delivery CARBOB gasoline in the Los Angeles wholesale market jumped on the news, traders said.
March CARBOB gasoline, which is mandated by the California Air Resources Board, was trading 16 cents a gallon over March RBOB futures on the New York Mercantile Exchange, up 8 cents from Tuesday's close.
Former Shell Oil President John Hofmeister said Exxon is famous for its focus on safety and California "focuses intently" on companies following regulations, but of course incidents still happen.
With respect to prices and supply, California is an island unto itself, so a 10 percent facility could impose a "pretty significant impact if this is going to impact gasoline production," Hofmeister said.
"California produces what it sells. It's a rather thin market because of the environmental conditions placed upon the mix of gasoline that's produced."
"[T]hey're already on summer grade gasoline in Southern California, so there really is no resupply readily available to make up for the shortfall," Lipow said.
Lipow said CARBOB prices spiked in the wholesale market because traders "just don't know how long this particular unit, which is called the cat cracker, is going to be down."
Read MoreUnsafe at any speed? Oil by rail's huge risks
The cat cracker is considered the heart of a refinery producing gasoline.
The refinery covers 750 acres, processes about of 155,000 barrels of crude oil per day and produces 1.8 billion gallons of gasoline per year, Exxon said.
Cory Milsap, an electrical contractor at the plant, said many workers were sent home after the explosion.
"All I heard was a loud sound and I saw people running.'' ... "All I saw was smoke and people running, so I made sure I got out of there,'' Milsap said.
Jason Hernandez, another plant employee, said, "I felt the explosion really, really hard through my body. I got scared, I'm not going to lie.''
Giselle Monreal, a neighbor who lives across the street from the plant, said the blast shook the ground like an earthquake, knocking a 52 inch (132-cm) flat-screen television off its stand onto a coffee table and shattering a window in her garage.
Exxon Mobil stock was down more than 2 percent in late afternoon trading.
Police said there had been an explosion and a two-alarm fire. Torrance police Sgt. Paul Kranke said roads were closed after the incident and ash was in the air.
Fire Department spokesman Steve Deuel said a small ground fire was quickly extinguished. He said a flare system was triggered for safety reasons. Firefighters and refinery crews also contained a gasoline leak caused by the blast, he said.
Reuters quoted David Campbell, the treasurer and secretary of the local chapter of the United Steelworkers, as saying the explosion happened near a fluid catalytic cracking unit of the refinery.
Deuel told a TV station that the explosion happened in a processing facility and the material involved was most likely gasoline.
—Reuters and The Associated Press contributed to this report