The hazard of compound floods is considerably higher than that of univariate flood drivers due to the non-linear effects of multiple factors. In recent years, severe tropical cyclone (TC) compound floods have frequently caused huge economic losses in China's coastal cities. However, the variability and characteristics of TC compound flood events have not been analysed so far due to limitations in data availability. Here, machine learning (ML) models are applied to determine the threshold of TC compound flooding in western Shenzhen. The results reveal an increase in the frequency of TC compound floods between 1964-2022, especially from the 1990s to the present, which is attributed to a decrease in the distance of TC maximum intensity to land (11.4 km per decade). This shift towards land is likely due to the changes in TC genesis locations, primarily driven by rising sea surface temperatures (SST), with the Atlantic Multidecadal Oscillation (AMO) variation also playing a role. Besides, there has been a significant increase in compound flood events occurring with extreme high sea level. This study also identified a higher risk of extreme TC compound flooding during the El Niño–Southern Oscillation (ENSO) neutral phase. Flood predictions based on the 'rainfall-sea level' threshold derived in this study enable decision makers to quickly assess TC compound flood risks. The findings will inform subsequent research on the atmospheric-hydrological processes and variability mechanisms of TC compound flooding.