The incident occurred around 9:15 a.m. Saturday while the man was body boarding and skin diving, authorities said. The man was swimming off Grey Whale Cove State Beach in San Mateo County "when he was bitten in the right leg by a 6-8 ft. great white shark," according to the local sheriff's office.
The man was able to swim to shore, where he was treated by firefighters and paramedics "with advanced life support measures" before being transferred to a local trauma center, according to Cal Fire, one of several first responders at the scene.
The man lost about a pint of blood and required a tourniquet, San Mateo County Fire District Battalion Chief Brian Ham told San Francisco ABC station KGO.
A helicopter wasn't able to land because of the clouds so he was taken in an ambulance to San Francisco General Hospital with non-life-threatening injuries, authorities said.
He was released from the hospital Saturday evening.
The beach was closed following the attack. The state park is handling the investigation.
"The surfer got a look at the shark, that's how he was able to say it was a young great white," Ham said.
An adult great white shark averages about 13 to 16 feet in length, but some can grow up to 20 feet, according to the Smithsonian Institution.
There were 33 unprovoked shark attacks on humans in the United States last year, three of which were fatal, according to data from the Florida Museum of Natural History at the University of Florida.
Nearly half of the unprovoked attacks occurred in Florida. The fatalities were in California, Hawaii and Maine.
Editor's note: The victim was sent directly to San Francisco General Hospital. The story has been updated.
ABC News' Alyssa Pone and Vera Drymon contributed to this report.