Given the global ageing population, exploring potential dietary prevention strategies to reduce the public health burden of frailty is critically important. Dietary flavonoids offer multiple health benefits; however, there is a scarcity of research evidence regarding their association with the risk of frailty in middle-aged and older adults. This study aimed to assess the association between dietary flavonoid intake and frailty risk among middle-aged and older U.S. adults and to analyse the potential roles of different flavonoid subclasses. This study involved 9063 participants aged ≥40 years. Frailty was evaluated using a frailty index, and flavonoid intake was estimated through two 24-h dietary recalls. Analyses were carried out via multivariable logistic regression, restricted cubic spline models, weighted quantile sum regression, and quantile g-computation models. Additionally, subgroup analyses and interaction tests were conducted for age and gender. The results indicated that higher intakes of total flavonoids and subclasses (anthocyanidins, flavan-3-ols, flavanones, flavones, flavonols) were significantly associated with a lower prevalence of frailty, but isoflavone intake was not associated with frailty. A nonlinear, L-shaped dose-response relationship was observed between total flavonoids and frailty risk. Flavonols and flavanones were identified as the main contributors to the overall effect. Age influenced the association between dietary flavonoids and frailty, with middle-aged adults benefiting more than older adults. This study provides new evidence supporting an inverse association between dietary flavonoid intake and frailty risk, especially for foods rich in flavonols and flavanones.