Natural polyamines, including spermidine (SPD), spermine (SPM) and putrescine (PUT), are evolutionarily conserved endogenous molecules crucially involved in central cellular processes. Their physiological importance may extend to the maintenance of cognitive function during aging. However, limited population-based epidemiological studies have explored the link between dietary polyamines and dementia risk. This study was a prospective analysis of 77,092 UK Biobank participants aged ≥ 60 years without dementia at baseline. We used Cox proportional hazard regression models to explore the associations between dietary polyamines and the risk of dementia, and restricted cubic splines to test the non-linear relationships. During a median follow-up of 12 years, 1087 incidents of all-cause dementia cases occurred, including 450 Alzheimer's disease (AD) cases and 206 vascular dementia (VD) cases. The fully adjusted hazard ratios (HRs) for the upper fourth quintile of dietary SPD, in comparison with the lowest quintile of intake, were 0.68 (95% confidence interval [95% CI]: 0.66-0.83) for the risk of all-cause dementia, 0.62 (95% CI: 0.45-0.85) for AD and 0.56 (95% CI: 0.36-0.88) for VD, respectively. A 26% reduction in dementia risk [HR: 0.74, (95% CI: 0.61-0.89)] and a 47% reduction in AD [HR: 0.53, (95%CI: 0.39-0.72)] were observed comparing the third with the lowest quintiles of dietary SPM. Dietary PUT was only associated with a reduced risk of all-cause dementia in the fourth quintile [HR (95% CI): 0.82 (0.68-0.99)]. Reduced risk was not found to be significant across all quintiles. There were 'U'-shaped relationships found between dietary polyamines and all-cause dementia, AD and VD. Stratification by genetic predisposition showed no significant effect modification. Optimal intake of polyamines was linked to a decreased risk of dementia, with no modification by genetic risk. This potentially suggests cognitive benefits of dietary natural polyamines in humans.