(CNN) -- A Newport, California, teenager was rescued after being trapped in a collapsed sand hole for more than 30 minutes, authorities said.

The incident occurred when the boy and his friends were at Newport Beach on Wednesday, the Newport Beach Fire Department said in a news release. Members of the group dug two separate holes and were tunneling toward one another when the tunnel's walls caved in, leaving the teenager buried 5 to 7 feet underground, the department said.

Other people on the beach immediately joined in the effort to uncover the boy, digging with "any utensils available," the fire department said. Authorities arrived on the scene and also worked to extricate him.

A video released by the fire department shows about a dozen people, clad in bathing suits and uniforms, shoveling into the sand. The video then shows the teen being hoisted out of the hole and placed on the ground as the crowd cheers.

After being freed, the boy was taken to a hospital, where he was found to be uninjured, authorities said. The fire department did not identify the boy or provide his age.

"The Newport Beach Fire Department would like to remind beachgoers that large holes dug in the sand can be very unstable and have in the past caused severe injuries and deaths," the fire department said in the news release.