A Long Beach man was rescued by helicopter Tuesday after getting trapped for two days behind a waterfall in a national park northeast of Bakersfield, according to the Tulare County Sheriff’s Office.

A video posted to social media on Wednesday showed the dramatic helicopter rescue of 46-year-old Ryan Wardwell from a nook behind the cascading waterfall on the Seven Teacups Trail in the Sequoia National Forest.

The hike’s trailhead is slightly more than 82 miles northeast of Bakersfield.

Wardwell told deputies he started walking on the trail on Sunday and “had planned to rappel the waterfalls,” according to the sheriff’s office.

When he didn’t return to his car Sunday night, they began searching for him using aircraft equipped with cameras and infrared technology.

On Tuesday morning, the Sheriff’s Office also sent out a search-and-rescue team along with a swift-water dive team.

Early Tuesday morning, a drone spotted Wardwell behind the large waterfall. After he was rescued, he told deputies he had “come off his rappel lines and got trapped behind the waterfall because of the extreme hydraulics of the river.”

Wardwell was flown to a nearby landing zone, where he was treated for dehydration and minor injuries, then reunited with his family members.

“The TCSO Emergency Services Division reminds the public to always be aware of their environment and capabilities, especially when navigating white water rivers,” the Sheriff’s Office said in the post.