MANILA, Philippines (AP) — The death toll in the massive floods that devastated parts of the Philippines over the Christmas weekend has climbed to 51, with 19 others missing, the national disaster response agency said Monday, as affected residents struggle to get back on their feet.

Photos on social media showed residents in Misamis Occidental province in Northern Mindanao sweeping away thick mud from the floors of their homes. In the seaside village of Cabol-anonan, coconut trees were uprooted and huts made of light material were nearly flattened.

The Northern Mindanao region in the south bore the brunt of the disaster, reporting 25 deaths, according to the National Disaster Risk Reduction and Management Council. Most of the deaths were from drowning and landslides, and among the missing were fishermen whose boats capsized.

Floods have subsided in most of the areas hit by bad weather that disrupted Christmas celebrations in the eastern, central and southern Philippines. But over 8,600 of the nearly 600,000 affected people remain in emergency shelters.

Over 4,500 houses were damaged by the floods, along with roads and bridges, and some areas still have disrupted power and water supply, the disaster management agency said. The government sent food and other essentials to flood-hit residents, deployed heavy equipment for clearing operations, and provided iron sheets and shelter repair kits, officials said. Teams from the capital Manila were sent to assist communities with limited clean water in setting up water filtration systems.

At least 22 cities and municipalities have declared a state of calamity, the disaster management council said. The move will allow the release of emergency funds and hasten rehabilitation efforts.

A shear line — the point where warm and cold air meet — triggered heavy rains in parts of the country last week, causing the floods, the state weather bureau said.