FRANKFURT, Germany (Reuters) - A firefighter died while trying to rescue residents trapped by major flooding in southern Germany after heavy rain that was expected to continue throughout Sunday.

The man, 42, was in a rescue boat carrying four firefighters that capsized late on Saturday. His body was recovered early on Sunday, said a spokesperson for the Bavarian town of Pfaffenbach an der Ilm, around 50 km (30 miles) north of Munich.

While municipalities had days to prepare for the flooding, rescue workers still had to evacuate hundreds of people as the water cut off some areas, authorities said.

"We owe our thanks and respect to the rescue workers and helpers who are battling the consequences of the floods in many places," Chancellor Olaf Scholz said on X.

Economy Minister and Vice Chancellor Robert Habeck pledged support for the affected regions during a visit on Sunday and noted that climate change is causing more severe weather events.

"Natural disasters have always accompanied mankind. What we are seeing is that the frequency of these events is increasing significantly. Record floods occur every few years ... record rainfall every few years," Habeck, of the Greens Party, told broadcaster n-tv.

Parts of Europe were hit by major flooding in 2021 that killed nearly 200, with Germany bearing the brunt. The disaster was largely blamed on the consequences of climate change and prompted calls for stricter warning and safety measures.

(This story has been corrected to remove the word 'public' in front of n-tv, which is not a public broadcaster, in paragraph 6)

(Reporting by Christoph Steitz; Editing by Frances Kerry)