In July 2021, intense rainfall in parts of Western Europe was followed by unprecedented flash flooding. The flooding killed many people, mostly in Germany, which was subsequently blamed on a lack of preparation by either authorities or the broader populace. Knowledge about people's awareness of a hazard, its impacts and possible adaptation can help improve hazard management. We used social media data to assess situational awareness, sentiments and behaviour before, during and after the flood. We analysed nearly 58,000 German Twitter (now X) messages about the flood using machine learning-based unsupervised topic modelling. We showed that message frequency translated into four phases with message content suggesting sender priorities shifted in each phase of the flood. Besides messages with weather updates, correlated topics included ‘Solidarity, recovery and aid’ and ‘Grief and empathy’ (together 22% of all tweets) and a set of four topics about climate change attribution, extreme weather, long-term flood protection measures and politics (together 38% of all tweets). Many topics depended on the phase of the flood and on the distance from the affected areas. For those near the affected areas, tweets about evacuation (in peak phase) and damage assessment (in recovery phase) were particularly prominent. The high engagement on Twitter to seek weather information might indicate awareness of the extreme climatic conditions before the flood, but the severity was unexpected. Social media data provided unprecedent citizen-generated real-time information. We discuss how rapid automated analysis could contribute to disaster communication and risk mitigation.