A San Bernardino County sheriff’s helicopter rushed a man to the hospital with life-threatening injuries Saturday before returning to rescue a woman with less-serious injuries.

Both were injured after falling while hiking the Cucamonga Peak Trail in the San Gabriel Mountains, authorities say.

Hugo Rivera, 50, of Los Angeles was spotted by a patrol helicopter about 400 feet below the trail, while Hortencia Brown, 42, of Thousand Oaks, was seen on the trail at an elevation of about 7,200 feet, according to a San Bernardino County sheriff’s news release.

Due to the steep terrain and remote location, a helicopter equipped with a hoist was called to rescue both hikers. After responding, its crew “determined Rivera was in immediate need of medical treatment and lowered rescue and medical personnel to him,” the news release states.

Rivera was placed in a stokes litter and hoisted aboard. After leaving rescuers with Brown, the crew flew Rivera to Arrowhead Regional Medical Center in Colton with life-threatening injuries, the news release states.

The crew returned after leaving Rivera at the hospital and lowered additional medical staff to Brown, who was placed in a rescue harness and hoisted aboard. According to the news release, her injuries were not life threatening and she was flown to a waiting ambulance.