A man in his 50s surfing off the California coast has survived an attack by a juvenile great white shark.

The man suffered minor injuries and was able to paddle himself to shore, supervising state park ranger Robert Colligan said.

The attack happened yesterday at 11.30am local time at the Sand Spit Beach in Montana De Oro State Park just west of San Luis Obispo.

The man who was surfing with a friend was one of several people in the water, Mr Colligan said.

"From what eyewitnesses said, the shark came up from underneath and hit him," said Mr Colligan, adding that witnesses described the shark as being 8 to 10ft long.

The unidentified man who lives in the San Luis Obispo area was bitten on the right hip.

A medic who happened to be visiting the beach on his day off treated the injury until more help arrived. The man was flown to a local hospital for treatment.

The beach remained open, but signs will be posted for three days warning the public of the attack, Mr Colligan said. .

Sharks are native to the area, and Mr Colligan said they are spotted several times a year.

He added that attacks like this are rare. A woman swimming with seals was killed by a shark in 2003 about 10 miles south of the site of yesterday's attack.