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.

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.

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.

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.