HALF MOON BAY — A man in his 20s died Monday evening at Francis Beach in Half Moon Bay after a hole he was digging collapsed and buried him alive beneath 4 feet of sand.

The man, identified as 26-year-old Adam Jay Pye of San Lorenzo, was trapped beneath the sand about 5:30 p.m. after hours of digging holes nearly twice as deep as he was tall, Cal Fire Capt. Jonathan Cox said. Pye was rescued within 35 minutes by a crew of more than 30 county firefighters and dozens of beachgoers, but he was pronounced dead at the beach, part of Half Moon Bay State Beach..

The man was spending time with family friends at a spot just off the RV park where he and another young woman dug two large, diagonal holes about 10 feet deep, then tried to connect them to make a tunnel, Cox said. While officials could not immediately say what caused the tunnel to collapse, Cox said the tide was about six to 10 feet away and that no water infiltrated the hole.

George Frey, a photographer on vacation from Utah, was on the beach with his family when he and his wife saw the tide inching closer and moved their chairs farther back on the beach. They were packing up to leave when Frey heard sirens and saw people running, then dropping to their knees and furiously digging.

“I left my daughter, ran over there and started digging with them,” said Frey, who added that rescuers had to dig about four feet deep before they could see the top of the man’s head. “It was quite a sight, the people coming together giving everything they had to save this kid — they were dripping in sweat and exhausted, but they didn’t stop.”

Frey said the further the group dug, the more sand kept rushing back in to the massive hole the man had dug. Rescuers began pulling metal signs off posts at the beach to act as barriers to the seemingly unending rush of sand.

“Sand is an extremely difficult substance to rescue anyone out of, especially when they’re completely buried in it,” Cox said. “It took a really concerted effort to pull the sand back, and there was a really overwhelming number of people — in a good way — who were digging to get him out.”

Firefighters laid a ladder horizontally over the hole, then perched across it to dig an airway for the man, Frey said. After 35 minutes of digging, they were able to pull him out of the hole. But following an hour of advanced of support, he was pronounced dead. The cause of death was “suffocation; sand hole entrapment.

While beachgoers are continually urged to exercise caution near cliffs and to avoid swimming in big surf, Cox urged residents to avoid digging holes too deep in the sand. Hidden dangers of the beach do not only exist by sea, Cox said, and as Monday’s tragedy demonstrated, sand can be just as unwieldy the tides.

“The sand had just engulfed this young man — he was standing up straight, like a soldier with his hands to his sides,” Frey recalled. “He was buried alive. He was buried alive in that hole that he dug.”

Follow Erin Ivie at Twitter.com/erin_ivie.