The Taiwanese hiker survived the ordeal but his girlfriend died three days before they were found.

KATHMANDU, Nepal — A Taiwanese trekker who was rescued after 47 days on a mountain in Nepal celebrated his 21st birthday at a hospital in the capital Friday.

A happy Liang Sheng-yueh cut chocolate cakes in his hospital room in Kathmandu, where hospital staff and a government minister sang “Happy Birthday.” His family members were expected to reach Nepal later Friday.

With a paper hat on his head, Liang joined his hands to thank the doctors and journalists who were at the birthday celebration. Doctors fed him pieces of cake.

“Thank you very much everyone for taking care of me,” Liang said. “I am sorry to make you worried. I hope that I can make contributions to society in the future and I will do my best to live up to my responsibilities.”

Dr. Chakra Raj Pandey said Liang is making good progress and was able to walk Friday with the help of physiotherapists.

Liang was rescued Wednesday, but his girlfriend died just three days before the two were discovered near a waterfall.

The doctor said Liang was happy to have survived but also sad about losing his girlfriend, 19-year-old Liu Chen-chun.

“She had lost hope of life the last week of her life. She was shouting, she was hopeless and she was in tremendous anxiety. It was impossible for her to survive,” Dr. Pandey quoted Liang as saying.

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.

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

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.

One of the rescuers, Dawa Tamang, said they were about13 miles from the nearest village.