An onshore pipeline that ruptured along a scenic stretch of the California coast spewed up to 2,500 barrels (105,000 gallons, 477,340 litres) of crude oil onto pristine beaches.

The leak occurred in a pipe that was carrying crude from an onshore facility toward refineries further down the chain of production. The oil spilled down a canyon, into a culvert running under a highway and into a storm drain that emptied into the ocean.

Santa Barbara oil beach
Workers clean up an oil leak that caused a slick in the Pacific Ocean along Refugio State Beach in GoletaLucy Nicholson/Reuters
Santa Barbara oil beach
A boom is laid on the Pacific to try to contain the oil slickLucy Nicholson/Reuters

The spill zone lies at the edge of a national marine sanctuary and state-designated underwater preserve that is home to 25 marine mammal species and 60 species of sea birds.

Wildlife teams were dispatched to rescue any birds, marine mammals and other animals injured by the spill. Authorities said the extent of wildlife damage was not immediately known, but photos show oil-covered pelicans and other sea life washed ashore.

Crews focused on three especially sensitive nesting areas for shore birds, including snowy plovers and least terns, a state Fish and Wildlife Department spokeswoman said.

Santa Barbara oil beach
A pelican covered in oil is seen along the coast of Refugio State Beach in Goleta, CaliforniaLucy Nicholson/Reuters
Santa Barbara oil beach
A volunteer holds an octopus covered in oil along the coast of Refugio State BeachLucy Nicholson/Reuters
Santa Barbara oil beach
A California sea lion hunts in the oil-contaminated water as a brown pelican flies over, near Refugio State BeachDavid McNew/Getty Images
Santa Barbara oil beach
A pelican covered in oil flies over an oil slick along the coast of Refugio State BeachLucy Nicholson/Reuters

Refugio State Beach and El Capitan State Beach, both popular seaside camping destinations, were to remain closed to the public through the Memorial Day holiday weekend, officials said. The area was also closed to fishing and shellfish harvesting.

Governor Jerry Brown issued an emergency proclamation to speed needed cleanup resources to the scene, saying, "We will do everything necessary to protect California's coastline."

Workers and volunteers scooped up globs of oil from the sand. Crews will also scrub soiled rocks, hose down contaminated areas and skim oil left behind, Coast Guard captain Jennifer Williams said. Boats towed booms into place to corral two slicks off the Santa Barbara coast.

Santa Barbara oil beach
William McConnaughey, who drove from San Diego to volunteer, carries buckets of oil collected along Refugio State BeachLucy Nicholson/Reuters
Santa Barbara oil beach
Buckets of oil collected from the site of the ruptured pipeline are seen at Refugio State BeachLucy Nicholson/Reuters
Santa Barbara oil beach
A volunteer shows off an oil-covered hand after helping to carry buckets of oil along Refugio State BeachLucy Nicholson/Reuters
Santa Barbara oil beach
Oil surrounds the feet of local resident Morgan Miller as he patrols the beach north of Goleta for wildlife affected by the oil leakDavid McNew/Getty Images
Santa Barbara oil beach
Spilled oil covers the sand and rocks at Refugio State BeachDavid McNew/Getty Images
Santa Barbara oil beach
Oil flows toward the ocean from an inland oil spill near Refugio State BeachDavid McNew/Getty Images
Santa Barbara oil beach
Globules of oil can be seen in the waves as the tide rises near Refugio State BeachDavid McNew/Getty Images

The 24-inch pipe where the leak occurred was built in 1991 had no previous problems and was thoroughly inspected in 2012, according to Plains All American Pipeline LP, which owns the pipe. The pipe underwent similar tests about two weeks ago, though the results had not been analysed yet.

Crude was flowing through the pipe at 31,7965 litres an hour when the leak was detected on Tuesday (19 May). By Wednesday, a four-mile (6km) stretch of beach was blackened, and an oil slick spanned more than nine miles (14km) of the ocean, the Coast Guard said.

Santa Barbara oil beach
An oil slick washes up along Refugio State Beach in GoletaLucy Nicholson/Reuters
Santa Barbara oil beach
Oil shimmers on the water along the coast of Refugio State BeachLucy Nicholson/Reuters