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.

(CNN) — A quick-thinking off-duty officer helped save a 24-year-old hiker who was trapped in a whirlpool on Saturday.

The hiker apparently misjudged the swiftness of the water as he tried to cross Angel Falls in California, police said, and became trapped in the cold spring water that was flowing 50 to 80 feet per second.

Nearby, off-duty California Highway Patrol Officer Brent Donley, who is trained in search and rescue, was also hiking in the area near Bass Lake in Madera County.

Donley used a strap from his backpack and tied it around a branch so the hiker could grab it, police said. He threw the branch to the man and then talked him through the rescue, according to a video released by California Highway Patrol Fresno.

With the help of a group of other hikers, Donley pulled the man, who hasn’t been named, to safety. He provided first aid until Search and Rescue officers arrived.

“This … call could have ended very badly if not for his help,” the Madera County Sheriff’s Office, which urged visitors not to cross swift water, wrote.

Angel Falls is one of the main attractions for hikers along the Willow Creek Trail, one of the most challenging trails, according to USDA Forest Service. The trail is nearly 3-miles long and has a moderate to steep climb. According to a local travel site for Bass Lake, the Willow Creek trail is dangerous because of the slippery rocks along the path.

The-CNN-Wire™ & © 2020 Cable News Network, Inc., a WarnerMedia Company. All rights reserved.