This is an archived article and the information in the article may be outdated. Please look at the time stamp on the story to see when it was last updated.

A rescue team lowered a scuba tank to a man and kept him alive even as waves crashed over the boulders where he got trapped along the shore in Oceanside early Saturday.

The remarkable rescue played out at the southern end of Buccaneer Beach, where large boulders line the sand where the high tide comes crashing in each day, KTLA sister station KSWB in San Diego reported.

Oceanside Fire Department got a call from a person who said they heard a man’s screams from a section of the boulders around 3 a.m. and tried to help him out before calling authorities. The victim said he had slipped and fallen between the large rocks, ending up trapped as the tide began to rise.

The Fire Department’s technical rescue team worked to release the man from the rocks, but waves were already crashing overhead and the victim was becoming submerged in water.

Rescuers lowered a scuba tank and regulator to the man so he could continue breathing, but eventually he passed out and was unable to keep the regulator in his mouth, OFD said.

About the time the victim lost consciousness, though, crews managed to make an opening large enough to pull him out and used secure webbing to pluck him from the rocks. Paramedics were able to revive the man and he was rushed to the hospital, where he was expected to survive as of Saturday morning.

The entire rescue played out in the span of about 45 minutes.

“To put it plainly, the Oceanside Fire Department saved this man’s life,” a department spokesperson said in a news release. “Firefighters were completely soaked by the crashing waves and time was running out with the incoming tide. Great teamwork and reliance on training helped produce a successful outcome.”

The agency urged people to avoid walking or playing on the rock walls that line beaches in the area.