Nepal has declared dead thousands of people who went missing during the catastrophic floods in August, taking the death toll from one of the worst natural disasters to hit the Himalayan country to more than 5,000.

For months officials in Nepal have worked to identify the bodies of people who were killed when a towering wave of water, ice and debris swept down a valley in Nepal, caused by the collapse of a high-altitude glacier on the Nepal-China border.

Related: After the flood: human suffering on an unfathomable scale in Nepal’s worst-hit districts

The disaster was unprecedented in scale for the small mountainous country, washing away entire villages. Rescue workers managed to recover 1,451 bodies, pulled from the mud and the river. But identifying them has proved an overwhelming task, with only 112 people formally identified in the months since.

On Thursday, the Nepal government finally declared dead 3,915 people still missing after the floods, pushing the probable death toll to more than 5,000. Among them were 623 foreigners from 19 countries, including the UK, Australia, India and the US. Many had been in Nepal on holiday, trekking on popular routes along the China border that were directly in the pathway of the flood waters.

Nepal’s government said the full death toll from the disaster remained unclear, as some of the missing people could be among the 1,451 bodies that had been recovered but not identified.

“The toll is not a clear addition as there might be an overlap with the bodies and body parts found,” said the disaster authority chief, Dharam Raj Uprety.

Nepal’s laws previously required a person to have been ​missing for 12 years before a declaration of death could be made, leaving families in limbo. However, the absence of death certificates for flood victims left many families unable to claim compensation, transfer property or settle other legal matters.

Uprety emphasised that by recategorising the missing as dead it would “enable victims’ families to get ​the death certificates required to get the ‌financial assistance”.

In China, where information about the flood was tightly controlled, 43 people have been declared dead and 519 missing, according to state media.

Nepal was overwhelmed by the scale of destruction from the tsunami-like wave of freezing water and debris that tore down the valley, with communities living along the river receiving no warning. Access to the worst affected sites proved highly complex for rescue teams, with roads washed away, and many places were accessible only by army helicopter for weeks.

In the days after, morgues ran out of space and a decision was made to bury more than 1,200 bodies in shallow mass graves, carefully numbering and tagging them for retrieval when a DNA match was found.

But with thousands of DNA profiles to process, fragmented remains and limited technical capacity and resources, experts said identifying bodies to return them to families was a daunting task. Most families have still not been able to bury their dead or perform last rites.

In September, Nepal’s prime minister, Balendra Shah, told the UN that the flood “was a warning to the world” about the increasing dangers of the climate crisis.

Nepal contributes less than 0.1% of global greenhouse gases that are feeding the climate emergency, but is one of the countries most vulnerable to it. Ministers have called for billions in climate compensation.

In October, the UN climate loss and damage ​fund committed $20m (£15m) in aid, falling far short of the $5bn Nepal estimates will be needed to repair the damage, which affected about 33,000 people and destroyed more than 7,500 homes.