An off-duty police officer in California described the process of rescuing a hiker who was trapped in a whirlpool over the weekend.

California Highway Patrol Officer Brent Donley told “America’s Newsroom” on Wednesday that four days earlier he was hiking with his wife and children on a trail behind the village of Bass Lake, which is about 14 miles from the south entrance of Yosemite National Park, when a woman approached him and told him a man was in the river and asked if he had a rope.

“I was carrying a backpack, we always carry our backpacks with us when we go hiking with stuff,” Donley, who happens to be trained in search and rescue, said.

“Unfortunately I didn't have a rope, but I had the paracord style drawstring that was in the backpack that I was able to cut out with my knife and make a rope out of, essentially.”

The Madera County Sheriff’s Office said on Facebook that the incident happened when the 24-year-old hiker from Fresno attempted to cross Angel Falls, which is near Bass Lake. The sheriff's office said the 24-year-old misjudged the swiftness of the water when he decided to walk across.

OFF-DUTY CALIFORNIA POLICE OFFICER RESCUES HIKER TRAPPED IN WHIRLPOOL

Donley noted that the 24-year-old was “pretty scared at that time.”

“He said that his feet, his hands and his legs and arms were numb and he was scared about how much longer he’d be able to hold on,” Donley said. “The water was fairly cold, but I was trying to keep him calm and focused on me rather than everybody that was trying to shout out to him because … I wanted to make sure he understood exactly the instructions I was giving him.”

Donley was able to pull the man to safety with the help of other Good Samaritans.

When host Sandra Smith asked Donley if he ever got a sense as to how the hiker ended up in the water he said, “from what I understand, he explained after the fact, that he tried to cross the river about 50 yards upstream and it was fairly shallow there, but extremely swift and he lost his footing and washed into the pool that he was in when I came upon him.”

He added that the hiker “was having a hard time getting to the surface because of the way that the water was at the time so he was able to grab onto some rocks or boulder that was under the surface and cling to that until we were all able to pull him out of the water.”

CLICK HERE TO GET THE FOX NEWS APP

"We sincerely thank Officer Donley for his quick-thinking and preparedness," the sheriff's office said. "This search and rescue call could have ended very badly if not for his help."

Fox News’ Travis Fedschun contributed to this report.