A teenage surfer survived a shark attack at Montaña de Oro State Park in Los Osos, California, on Tuesday after receiving about 50 stitches.

According to the Tribune, of San Luis Obispo County, Nick Wapner — a sophomore at California Polytechnic State University — was surfing at the state park around 10 a.m. when a great white shark came up from beneath him and bit one of his legs.

“It all happened quickly, but I turned and saw that it had one of my legs in its mouth,” Wapner, 19, told the newspaper.

RELATED: 13-Year-Old Boy in Serious Condition After Being Attacked by 10-Foot Shark in San Diego County

“All of a sudden my feet just went straight up in the air and I just felt like this tremendous pressure around my ankles and my legs,” Wapner explained to local station KCOY-TV.

Wapner, who is a trained lifeguard and longtime surfer, kicked at and struggled with the shark until it eventually let him go — what he estimates to the Tribune was only a few seconds later.

“I was able to get a couple kicks in on its head and then it miraculously let me go,” Wapner told CBS.

“I think between the fiberglass board and me, it realized pretty quickly it wasn’t a seal,” Wapner added to the Tribune. “Fiberglass isn’t too tasty, I don’t think. For the shark, it was probably just a play tap really, but for me it was a major ordeal.”

RELATED: 26-Year-Old Killed in Cape Cod Shark Attack Was Planning to Propose to Girlfriend, Friend Says

Local California surfing organization Still Frothy posted a picture of Wapner’s surfboard on Instagram.

Wapner told the Tribune that he believes the shark was a great white, and estimated it to be about 15 feet in length with an 18-inch dorsal fin.

After paddling back to the beach, one of Wapner’s friends quickly drove him to the hospital, Sierra Vista Regional Medical Center in San Luis Obispo. He received 50 stitches before being discharged later in the day, according to the Tribune. 

“I’m happy to be alive,” he told the newspaper. “I’m still in shock. I got off really lucky.”

The Montaña de Oro State Park did not immediately respond to PEOPLE’s request for comment.