A California man digging a hole in the sand died when the hole collapsed around him, burying him in the sand for at least five minutes.

Adam Jay Pye, 26, was standing inside the 10-foot-deep hole he dug at Francis State Beach when the sand suddenly caved in, USA Today reported. Pye's friends and bystanders at the beach rushed to the scene and began digging with their hands and buckets.

After five minutes they uncovered his head. State firefighters arrived at the scene and were able to completely dig Pye out of the sand 35 minutes later.

"When they got there, they discovered he was unconscious," Jonathan Cox, captain of the California Department of Forestry and Fire Protection, told the Associated Press.

Pye, who recently graduated from college, was pronounced dead at the scene. He was out for a day at the beach with friends before a scheduled trip to New York, his mother told the San Francisco Chronicle.

The victim's family set up a page at the fundraising website youcaring.com to accept donations.

Cox said the hole Pye was digging was about 10 to 15 feet from the water line, the AP reported.

Last month, a 49-year-old Virginia man died after the sand tunnel he was digging on a North Carolina beach collapsed on top of him.

Cyndy Holda, a spokeswoman for the National Park Service, previously told The Virginian-Pilot that holes can collapse if the wet sand dries from sun exposure.

While deaths caused by collapsed sand holes are uncommon, officials warn against digging holes that are deeper than someone's knees.

"It is rare," Holda told The Virginian-Pilot. "It's probably too deep to be safe if you are using a shovel."