(CNN) -- Two hikers who were missing for nearly five days used a water-purifying straw to survive and were rescued after search teams discovered and followed two sets of footprints in a California canyon, according to the local sheriff's office.
Eric Desplinter, 33, and Gabrielle Wallace, 31, got lost while hiking near Mount Baldy in San Bernardino County, California, last Saturday.
"We just lost the trail," Desplinter said after being rescued Wednesday night, according to CNN affiliate KCAL/KCBS. "And had a little bit of a slip going to the peak of Cucamonga Peak. We decided we wouldn't go back up the ice and snow, so we tried to descend through a valley."
"But that valley was more treacherous than we thought," he added.
To survive over the next several days, Desplinter said he and Wallace tried their best to keep warm, rationed their food and drank water through a LifeStraw -- a straw-like tube that purifies water. They're used by hikers and have also been used for humanitarian purposes, providing clean water to people who might not have access to it otherwise.
The pair had gone hiking with a group but ended up getting separated, Wallace's mother told KCAL/KCBS.
According to a statement from the San Bernardino County Sheriff's Office, search and rescue teams from multiple agencies in the surrounding area had spent days combing an area of approximately 30 square miles, or 19,000 acres.
Desplinter and Wallace were finally found after a search team discovered two sets of footprints in Cucamonga Canyon and followed them.
The team provided the location to the command post, and a helicopter flew over the area. From the air the crew was able to spot a campfire and saw two people believed and later confirmed to be Desplinter and Wallace, the sheriff's office said.
According to dramatic footage from the sheriff's office, they were hoisted out of the canyon one at a time in the dark of night as the helicopters blades spun about 10 feet away from nearby trees and rocks.
"Thank you to all the volunteers who were helping look for us," Desplinter said. "We are very grateful to be found tonight."