Rainfall variability strongly influences both flood and drought hazards, especially in climatic transition zones where precipitation is highly seasonal and spatially heterogeneous. This study assessed long-term changes in rainfall patterns and compound flood–drought hazard in the Huaihe River Basin, China, using ERA5-Land-derived daily precipitation series at 174 spatial sampling locations during 1950–2025. Rainfall pattern indicators, flood-related rainfall extremes, and SPI-3-based drought indicators were calculated to characterize rainfall amount, frequency, intensity, dry–wet persistence, heavy rainfall events, and meteorological drought conditions. The Mann–Kendall test and Sen’s slope estimator were used to detect long-term trends, and a compound flood–drought hazard classification framework was developed based on a flood-related rainfall hazard index (FHI) and a drought-related hazard index (DHI). The results showed that annual total precipitation, wet days, and consecutive wet days decreased significantly, indicating reduced rainfall occurrence and wet spell persistence. Flood-related rainfall indicators generally showed decreasing tendencies, with more evident declines in persistent multi-day extremes than in single-day rainfall. In contrast, mean SPI-3 showed a significant drying tendency, although drought frequency, severe drought frequency, and drought intensity did not exhibit significant monotonic trends. Spatially, rainfall pattern, flood-related, and drought-related indicators showed clear heterogeneity across the basin. The compound hazard classification identified flood-dominated and drought-dominated areas as the two major hazard types, each accounting for 31.03% of the spatial sampling locations, while low compound hazard and compound flood–drought hazard areas each accounted for 18.97%. These findings indicate that flood- and drought-related hazards coexist but vary spatially across the Huaihe River Basin. The proposed framework provides preliminary rainfall-based information for differentiated flood–drought hazard assessment, climate-adaptive water resources planning, and the sustainable management of water resources in regions facing spatially heterogeneous hydroclimatic hazards.