The aim was to systematically analyse the association of the specific flavonoids, Mg and their interactions from different food sources with the metabolic syndrome (MetS) and its components in a cohort study. A total of 6417 participants aged 20 to 74 years from the Harbin Cohort Study on Diet, Nutrition and Chronic Non-communicable Diseases were included. Multivariate logistic regression analyses, forest plot and restricted cubic spline were performed in the study. After a 5·3-year follow-up, 1283 incident cases of the MetS were reported. Those with a higher total flavonoid intake had a lower risk of the MetS (fourth v. first quartile, relative risk (RR) 0·58; 95 % CI 0·37, 0·93; P = 0·024) and central obesity (RR 0·56; 95 % CI 0·33, 0·95; P = 0·032). Further analysis showed that the specific flavonoids quercetin, kaempferol, isorhamnetin, luteolin, and flavonoids from fruits, potatoes and legumes had the similar associations with risk of the MetS and central obesity (P < 0·05 for all). A higher intake of total flavonoids, quercetin and luteolin combined with a high level of Mg was more strongly associated with a lower risk of the MetS (RR 0·60; 95 % CI 0·45, 0·81 for total; RR 0·61; 95 % CI 0·45, 0·82 for quercetin; RR 0·52; 95 % CI 0·38, 0·71 for luteolin; all Pfor interaction < 0·01). Dose–response effects showed an L-shaped curve between the total intake of five flavonoids and the risk of the MetS. A higher flavonoid intake is associated with a lower risk of the MetS and central obesity; their combination with Mg helps to strengthen their negative association with the MetS.