Workers begin their day of cleaning oil from Refugio State Beach on May 23, 2015, in Goleta, Calif. (Justin Sullivan/Getty Images)

The pipeline that leaked thousands of gallons of oil on the California coast was the only pipe of its kind in the county not required to have an automatic shut-off valve because of a court fight nearly three decades ago, a county official said.

The original owner of the pipeline skirted the Santa Barbara County requirement by successfully arguing in court in the late 1980s that it should be subject to federal oversight because the pipeline is part of an interstate network, said Kevin Drude, deputy director of the county’s Energy and Minerals Division. Auto shut-off valves are not required by federal regulators.

“It’s the only major pipeline that doesn’t have auto shut-off,” Drude said. “For us, it’s routine.”

Federal regulators are investigating the cause of Tuesday’s leak that spilled up to 105,000 gallons of crude oil from an underground pipe into a culvert and as much as 21,000 gallons into the ocean at Refugio State Beach. The spill killed untold numbers of fish, a few pelicans and mired other birds, sea lions and at least one elephant seal in the muck.

Plains All American Pipeline was still draining the pipe and trying to locate the leak Friday. Federal regulators ordered the company to remove the damaged section and send it to a lab for tests on the metal, along with a series of other steps before it could resume pumping oil through the pipe to inland refineries.

While it’s not known whether an auto shut-off valve would have detected the leak and reduced the size of the spill, environmentalists have criticized the lack of such a device, saying it could have shut the leaking pipe down sooner.

“Everyone is pretty mystified why the pipeline didn’t automatically shut down when the leak occurred,” said Linda Krop, chief counsel of the Environmental Defense Center.

County regulations sometimes go beyond state and federal standards, requiring additional environmental analysis or imposing conditions to further protect health and the environment, Drude said. One additional requirement that’s standard is a valve that can detect changes consistent with a leak and automatically shut down.

Richard Kuprewicz, president of Accufacts Inc. who investigates pipeline incidents, said such valves aren’t always effective, though newer more sophisticated “smart” models provide more accurate signals that can trigger shutdowns.

— Associated Press