Media playback is unsupported on your device Media caption Early reports said that about 21,000 gallons (95467 litres) of oil had spilled, but that figure could rise

A state of emergency has been declared in southern California in the US after two oil slicks, stretching nine miles, formed off the coast.

The spill near Santa Barbara was caused by a ruptured onshore pipeline.

Officials said the pipeline was running at full-capacity when it broke on Tuesday and about 105,000 gallons (400,000 litres) may have spilled.

While it has now been switched off, it is unclear how long the clean up will take.

Earlier estimates said a single slick had formed, stretching only four miles.

Emergency workers have been fanning out across Refugio State Beach to remove oil that is stuck to sand and rocks.

It is estimated about 21,000 gallons of oil have reached the ocean.

California Governor Jerry Brown declared the state of emergency on Wednesday to help the state "quickly mobilise all available resources".

"We will do everything necessary to protect California's coastline," he added.

Image copyright EPA Image caption Some are concerned that oil spill could harm wildlife including birds and whales

Image copyright Reuters

Darren Palmer, an official with Plains All American Pipeline LP, who owns the pipe, said it was running at a rate of about 84,000 gallons an hour when it broke.

The pipe was built in 1991 and had been tested a few weeks ago, he said.

Mr Palmer said the company takes responsibility for the spill and will pay for the cleanup.

Environmentalists are concerned that the oil may harm wildlife including birds and whales.

"It smells like what they use to pave the roads," Fan Yang told the Associated Press news agency. "I'm sad for the birds, if they lose their habitat."

The spill happened on the same stretch of beach as a 1969 spill - one that is credited with starting the American environmental movement. In that incident, several hundred thousand gallons spewed from a blowout on an oil platform, ultimately resulting in the death of thousands of seabirds and many marine mammals.

Image copyright Getty Images

Image copyright Reuters

The alarm was first raised on Tuesday when authorities received reports of a foul smell near Refugio State Beach around midday (04:00 GMT).

Emergency responders found a half-mile slick in the ocean, Santa Barbara County Fire Captain Dave Zaniboni said.

They traced the oil to a ruptured onshore pipeline that was spewing oil into a rain water drain which ran to the ocean. The pipeline was shut off about three hours later.

The area has been closed to recreational and fishing activities. It is not clear if the area will be open for the coming Memorial Day weekend - a major holiday in the United States.