KAWAGOE, JAPAN — One by one, the boats arrived, having crossed a lake that did not exist the day before. They carried precious cargo: old-age patients rescued from a flooded nursing home in an exurb of Tokyo.

As Typhoon Hagibis slammed into Japan on Saturday, record levels of rain pummeled vast swaths of the country, pushing 77 rivers beyond their limits and killing at least 40 people. Even major urban centers suffered severe damage, a humbling reminder of vulnerabilities for a country that prides itself on robust infrastructure and preparedness in the face of frequent natural disasters.

Dra matic rescues played out across several trouble spots on Sunday as Japan confronted the destruction wrought by the storm, with residents pulled off roofs by helicopters or rowed out of the floodwaters in boats.