LOS ANGELES (Reuters) - A pipeline ruptured along the scenic California coastline on Tuesday, spilling some 21,000 gallons (79,000 liters) of oil into the ocean and on beaches before it could be secured, a U.S. Coast Guard spokeswoman said.

The pipeline, which runs parallel to Highway 101 near Santa Barbara, left a slick extending about four miles (6.4 km) along Refugio State Beach, extending about 50 yards (46 meters) into the water, Petty Officer Andrea Anderson of the Coast Guard said.

Anderson said the company responsible for the 24-inch (61- cm) pipeline was identified as Plains All American Pipeline, which had brought in a company to begin cleaning up the spill. Refugio State Beach was closed.

The cause of the rupture had not been determined, Anderson said.

Richard Abrams, emergency manager for Santa Barbara County, said the Coast Guard, Department of Fish and Wildlife and Santa Barbara County were assisting on the clean-up.

"We haven't seen any reports of impacts on wildlife but it is in the water so it is impacting the environment," Abrams said.

Plains said it shut down the flow of oil in the pipeline after the rupture and initiated its emergency response procedures.

"Plains deeply regrets this release has occurred and is making every effort to limit its environmental impact. Our focus remains on ensuring the safety of all involve," the company said in a statement.

(Reporting by Rory Carroll in San Francisco, Nallur Sethuraman in Bengaluru and Dan Whitcomb in Los Angeles; Editing by Lisa Shumaker, Eric Walsh and Michael Perry)