An adequate magnesium intake might lower the risk of frailty through its role in muscle function. We analysed data from 81524 women aged ≥60years participating in the Nurses' Health Study. Total magnesium intake was obtained from repeated food frequency questionnaires administered between 1984 and 2010 and self-reported information on supplementation. Frailty was defined as having at least three of the following five FRAIL scale criteria: fatigue, low strength, reduced aerobic capacity, having ≥5 chronic illnesses and weight loss≥5%. The occurrence of frailty was assessed every 4years from 1992 to 2018. Cox proportional hazards models adjusted for lifestyle factors, medication use and dietary factors were used to assess the association between magnesium intake and frailty. During a median follow-up of 16years, we identified 15477 incident cases of frailty. Women with a higher intake of total energy-adjusted magnesium had a decreased risk of frailty after adjustment for lifestyle factors, medication use and dietary factors. The relative risk (95% confidence interval) for Quintile 5 (Q5) versus Quintile 1 (Q1) was 0.88 (0.82, 0.94) (P-trend<0.001). When only energy-adjusted magnesium from the diet was considered, the inverse association was stronger (Q5 vs. Q1: 0.68 [0.56, 0.82]; P-trend<0.001). Those reaching the recommended daily allowance (RDA) of magnesium through diet had a 14% (9%, 19%) lower risk of frailty compared with those not meeting the RDA. Increased intake of foods rich in magnesium was associated with a decreased risk of frailty.