A 32-year-old barefoot hiker was rescued from the Huachuca Mountains late Tuesday after the wind and snow collapsed his tent, law enforcement and U.S. Customs and Border Protection officials said.

James Brady was suffering with hypothermia, exposure and frostbite when he was hoisted into a helicopter operated by the CBP’s Air and Marine Operations crew, a CBP spokesman said earlier this week.

Brady’s hiking boots had frozen and his tent had collapsed sometime early Tuesday when the Huachuca Mountains were getting pummeled by snow. The Cochise County Sheriff’s Search and Rescue team went looking for Brady, but when they realized they were still about two miles from his location on Tuesday at about 4:30 p.m., they called the Arizona Department of Public Safety for a chopper.

According to the Search and Rescue team’s Facebook page, the helicopter was dispatched, but as it got closer, it couldn’t make the rescue.

“As they approached the location the aircraft suffered a mechanical problem and departed the area to the Sierra Vista airport,” the Facebook post says. “Requests went out to the US Air Force 943rd Rescue Squadron and US Customs Air and Marine, both located at Davis Monthan Air Force Base in Tucson for a hoist equipped helicopter to recover the subject and SAR personnel.”

The CBP’s Air and Marine dispatched a Black Hawk that dropped a hoist 150 feet down into the mountains in order to retrieve Brady.

“Upon arrival in the dark of night, the Black Hawk crew lowered an aviation enforcement agent emergency medical technician 150 feet to the mountains below,” a CBP spokesman said. “The agent performed an assessment of the situation on the ground, accompanied the barefoot hiker on the 150-foot hoist back up to the hovering helicopter.”

Brady was taken to Montezuma’s Pass where Search and Rescue medical personnel were waiting to warm him up. CBP officials said the Black Hawk crew went back and retrieved the Search and Rescue teams that had attempted to help Brady. The latter was later flown to Canyon Vista Medical Center in Sierra Vista.

Cochise County Sheriff’s spokeswoman Carol Capas said Brady was rescued at about 10:22 p.m. Tuesday. The Sheriff’s Office received a call at about noon the same day from Brady’s brother.

“He said Brady had left on Monday night and had hiked about three and a half miles before he set up camp,” Capas said.

Tuesday morning, Brady’s tent broke down and he discovered that his boots had frozen overnight, Capas said. He called his brother with his cell phone and the sibling called the Sheriff’s Office. Two Search and Rescue teams responded.

“Fortunately, this hiker was able to have cell phone service so he could call for help,” Capas said.

She said preparedness is the key for anyone embarking on a hike, whether it’s in the heat or cold. Aside from being aware of weather conditions and being equipped with a cell phone, water, food and the right shoes and clothing, Capas said it’s also crucial to tell someone where you’re going.

“If you don’t have a (hiking) partner, make sure you always let someone know where you are,” Capas said.