Emergency workers scrambled to rescue residents trapped by floods in and around the Philippine capital on Sunday as Tropical Storm Nalgae swept out of the country after killing at least 48 people.
Several neighbourhoods in towns and cities just outside Manila remained under water after the storm raked across the main island of Luzon overnight, cutting power supplies and inflicting damage.
The death toll from the storm rose to 48, the national disaster agency said on Sunday, most of them from a series of flash floods and landslides that destroyed villages on the southern island of Mindanao on Friday.
In the Manila suburb of Paranaque, rescuers swam through three-metre (10-foot) floodwaters overnight to reach 60 people including children marooned on an upper floor of a building, a local official said.
"They were shouting and crying in panic because they really have no way out" after floodwaters rose as they attended a party, village chief Noel Japlos told AFP.
"We did not expect the water to go this high. If we weren't able to rescue them all, some of them could have died," he added.
Video footage taken by the rescue team showed emergency workers in life vests using a rope to lead them out of the building while children were put on improvised floats.
In nearby Kawit town, a corpse in a white coffin floated on a flooded street, an AFP photographer saw.
Residents said a flash flood overnight likely carried it off from a nearby cemetery.
Kawit residents emerging from receding floods were cleaning up and trying to dry their wet belongings.
"It's so difficult because we can't move around due to the flood and we have a two-month-old baby who can't sleep because there's no electricity," Andinor Cairme, a street sweeper, told AFP.
The storm slightly weakened as it roared out into the South China Sea, the state forecaster said.
Port operations have also slowly resumed as thousands of stranded passengers travel in time for the All Saints' Day holiday on Tuesday, when millions of Filipinos visit the graves of relatives.
The civil defence office said 22 people were missing and 40 were injured with bridges, roads and crops also destroyed.
An average of 20 typhoons and storms hit the Philippines annually, killing hundreds each year and leaving vast areas of the country in perpetual poverty.