KATHMANDU, Nepal -- A Taiwanese man who was missing on a mountain in Nepal for 47 days was rescued Wednesday, but his girlfriend died just three days before they were discovered, trekking officials said.

Asian Trekking agency official Madhav Basnet said 21-year-old Liang Sheng Yueh was found Wednesday on a ledge under a waterfall and was flown by helicopter to a hospital in the capital, Kathmandu. He said the body of his girlfriend, 19-year-old Liu Chen Chun, was also taken to the capital.

They were on a long trek on the Ganesh Himal trail, which is not as crowded as other popular routes, and were caught in a snowstorm in March and lost their way.

Get Breaking News Delivered to Your Inbox

According to Basnet, they appeared to have followed a river hoping to find a village but slipped and fell over a waterfall. They landed on the ledge and were unable to climb up or down. The area is an altitude of 8,520 feet.

Basnet said the weather improved a few days after the snowstorm, but the temperature was unclear.

They had no guides or porters and were carrying their own food, tent and sleeping bags.

For the first two weeks they survived on food they had in their backpacks but after that they consumed only salt and water, he said.

Rescuers first scoured the area for two weeks before suspending their search, but resumed the search on April 20.

Basnet said they spotted a red tent and managed to climb down.

“We found the man alive and able to speak to us, but the woman was already dead. We could not carry them so we called a helicopter,” Basnet said.

The man was winched up by the helicopter and immediately flown to Kathmandu, followed by the body of the woman.

The man appeared to be in good health in the emergency room.

A family member gives water to Liang Sheng-yueh at the Grande Hospital in Kathmandu, Nepal, on Wed., April 26, 2017, after his rescue. AP

“He appears exhausted and lost some 30 kilograms [66 pounds] of body weight,” said Ajay Singh Thapa, a doctor at the Grande Hospital. “He was suffering from severe malnutrition. His foot was covered with maggots and hair full of lice. Despite having to live like that for 47 days, he appears to be mostly normal.”

He said the man probably could survive because he was able to get both salt and water in his body.

The man said he spent the past three days next to the body of his dead girlfriend.