A teenager in Newport Beach, Calif. digging a hole at the beach is in good condition after five feet of sand collapsed on top of him, burying him for nearly 30 minutes Wednesday.

According to the Orange County Register, paramedics and lifeguards got the call at 3:38 p.m. that the sand had caved in over him. About 40 emergency services personnel and beachgoers frantically dug through the sand to find the teen:

Resident Skip Snead told the Register he was driving home when he saw fire and police cars by the beach and he rushed over to see what was happening. He saw everyone digging, looking for a limb or other sign of life, with hundreds of spectators watching.

“Everybody was thinking, ‘They’re going to pull up a dead body,’” Snead said.

Beachgoers cheered when he was extricated after almost half an hour and moved his body and showed he was alive. He was transported to a local hospital.

“Everyone went crazy,” Snead said. “I think he was in shock.”

According to the OC Register, a 7-year-old boy died in a similar incident about 20 years ago. In 2006, a 13-year-old survived after being trapped under sand as well.