KATHMANDU, Nepal — The rescue team had nearly given up when it spotted distant figures on a ledge.

Over the course of 47 days, since two young Taiwanese trekkers wandered off the trail in a snowstorm, the searchers had tried almost everything: aerial surveys by helicopter, bushwhacking through deep forest, trying to follow the movements of vultures.

The father of Liang Sheng-Yueh, one of the missing students, had even consulted an astrologer. But they found nothing.

Alerted by a fellow searcher who saw what he assumed were two bodies on the ledge, the leader of the rescue team, Madhab Basnet, carefully made his way to the site, using a handmade ladder the rescuers had quickly fashioned. When he reached the ledge, he was shocked when one of the two, an emaciated and badly weakened young man, spoke to him.

He said that his girlfriend, Liu Chen-chun, 19, had died three days before.

“He said his girlfriend was in a lot of pain and grief,” Mr. Basnet said. “He said he ate salt and water and that’s how he survived.”