The victim of a fatal shark attack at a Central California beach cried out to his friend for help as the shark flashed out of the water, bit into his leg and pulled him under in a tide of red blood, the friend said.

Matthew Garcia was two feet away from his friend, 19-year-old Lucas Ransom, when the shark attacked, he said. The whole incident lasted seconds.

"When the shark hit him, he just said, 'Help me, dude!' He knew what was going on," Mr Garcia said.

"It was really fast. You just saw a red wave and this water is blue - as blue as it could ever be - and it was just red, the whole wave."

As huge waves broke over his head, Mr Garcia tried to find his friend in the surf but could not.

He decided to get help, but turned around again as he was swimming to shore and saw Mr Ransom's red bodyboard pop up. Mr Garcia swam to his friend and did chest compressions as he brought him to shore.

Mr Ransom already appeared dead and his leg was mauled, he said.

"He was just floating in the water. I flipped him over on his back and underhooked his arms. I was pressing on his chest and doing rescue breathing in the water," Mr Garcia said. "He was just kind of lifeless, just dead weight."

The University of California, Santa Barbara, junior had a severe wound to his left leg and died a short time later at Surf Beach, the Santa Barbara County Sheriff's Department said in a statement.

The beach, 130 miles northwest of Los Angeles, is on the property of Vandenberg Air Force Base but is open to the public.

Sheriff's deputies patrolled the coastline to search for Mr Ransom's missing leg but were only able to recover the boogie board, which had a one-foot segment on the side bitten off.

The ocean was calm and beautiful before the attack, with large wave sets that the friends had been tracking all week as they moved down the West Coast from Alaska, Garcia said.

The shark, which breached the water on its side, appeared about 18 feet long, Mr Garcia said.

"There was no sign, there was nothing. It was all very fast, very stealth," said Mr Garcia, 20.

Authorities issued several warnings this year after great white shark sightings up and down the California coast.

There have been nearly 100 shark attacks in California since the 1920s, including a dozen that were fatal, according to the California Department of Fish and Game.

But attacks remained relatively rare even as the population of swimmers, divers and surfers sharing the waters soared.

The last shark attack on Surf Beach was in 2008, when what was believed to be a great white shark bit a surfer's board. The surfer was not harmed.

The last fatal attack in California was that same year, when triathlete David Martin, 66, bled to death after a great white shark bit his legs about 150 yards off a San Diego County beach.

Randy Fry, 50, died from a great white attack in 2004 while diving off the coast of Mendocino, north of San Francisco Bay.

In 2003, a great white shark killed Deborah Franzman, 50, as she swam at Avila Beach, about 30 miles north of Vandenberg.

Sign up to our free newsletters

Get the best updates straight to your inbox:
Please select at least one mailing list.

You can unsubscribe at any time by clicking the link in the footer of our emails. We use Mailchimp as our marketing platform. By subscribing, you acknowledge that your information will be transferred to Mailchimp for processing.