SAN PEDRO, CA — A quick-thinking good Samaritan is being credited today with saving the life of a surfer attacked by a shark near the remote Santa Rosa Island off the Southern California coastline.

The surfer is recovering today in stable condition after a shark gripped his leg and pulled him under water Saturday. Today, U.S. Coast Guard officials credited a bystander with saving his life by tying a tourniquet to his leg to staunch the flow of blood until help could arrive nearly 30 minutes later.

"We are so grateful to the good Samaritan who jumped in to save this guy," Petty Officer Mark Barney told CNN. "It's not like the New Jersey shore where out there where you might have 100 people the beach. Santa Rosa Island is remote especially out there on the northwest side where he (the victim) was surfing.

"This could have gone in a different direction, but thankfully the good Samaritan was out there. They applied the tourniquet, which is crucial. You have to get a grip on the blood flow, and that good Samaritan had their head in the right place and did everything properly."

Bystanders pulled the injured surfer into a boat and communicated his location to the Coast Guard, which deployed a helicopter to hoist him up and rush him to a hospital.

The L.A.-based Coast Guard dispatched a helicopter after receiving a call about the attack around 3:15 p.m. Saturday, officials said.

The 37-year-old man suffered significant blood loss before the tourniquet was applied, but he was airlifted an hour later to the Santa Barbara Airport, where medical units were waiting, officials said.

"This is the best possible outcome to a truly terrifying situation," said Lt. Benjamin McIntyre-Coble, the Coast Guard Sector-Los Angeles-Long Beach command duty officer.

'"We are all happy that he will be able to be with his family in time for the holidays," he said.

A man claiming to be the friend tweeted about the experience, writing that he saw a 15-foot great white shark attack from below, shattering the surfer's board and dragging him under water. Authorities have not yet identified the breed of shark responsible for the attack, but great whites tend to be responsible for most of California's rare attacks, according to the International Shark Attack File.