VENTURA, Calif. — Thousands of gallons of crude oil spilled Thursday from a pipeline and flowed down a ravine in Southern California but did not reach the ocean, officials said.

As much as 29,400 gallons of oil spilled and flowed a quarter- to half-mile from the spill, fire authorities said.

The line operator, Crimson Pipeline LLC, estimated that at most 25,200 gallons were released, said spokeswoman Kendall Klingler.

The cause was under investigation, she said.

“The product has been contained and we are in cleanup and mitigation,” she said.

The spill occurred in the Hall Canyon area above the city of Ventura and flowed into the Prince Barranca, a ravine that ends at San Buenaventura State Beach near the Ventura Pier.

Fire departments responded and a pump house operating the line was shut down. Firefighters built a dam out of dirt to keep the oil from moving farther.

“It didn’t make it into the ocean,” said Ventura County fire Capt. Scott Quirarte.

The oil left a black stain down the brush- and tree-filled arroyo and did not spread elsewhere.

Initial projections that up to 210,000 gallons may have spilled were later reduced.

Quirarte said the spill was reported in a 911 call from a resident at 5:35 a.m.

Resident Kirk Atwater, 56, said he called 911 after smelling and hearing the flowing crude.

“We started getting this horrendous smell and I knew right away what it was,” he said.

Atwater said he went up the canyon on his motor scooter and found the oil gushing from an above-ground box that he surmised covers equipment.

“It was just pouring out like water coming out of a fire hydrant,” he said.

He said he found a posted phone number and reported the leak to the pipeline company.

Firefighters had a training exercise with Crimson and an oil spill cleanup company about two weeks ago, including building a dam as was done Thursday, Quirarte said.

“We train so that when there is a problem or issue we’re ready to respond,” he said.

A company press release from April said Crimson’s California network traverses about 1,000 miles and moves nearly 200,000 barrels — 8.4 million gallons — of oil daily.

The spill came 13 months after more than 120,000 gallons of oil spilled on the coast of neighboring Santa Barbara County. Some of the crude flowed into the ocean at Refugio State Beach and killed birds and sea lions.

That pipeline, owned by Plains All American Pipeline, was found to have corrosion.

Federal regulators said last month that Plains failed to prevent corrosion in its pipes, detect the rupture or respond swiftly as crude streamed toward the ocean on May 19, 2015.

The report was issued just two days after Plains was indicted in Santa Barbara County Superior Court on 46 criminal counts, including four felonies of polluting state waters and three dozen misdemeanors of harming wildlife.

More in Technology

A new report says Facebook CEO Mark Zuckerberg has gone to "war" in response to criticisms of the company. And his new approach has led to friction with several top executives, including Sheryl Sandberg.