Nutrition intake is one of the modifiable risk factors for cognitive decline. Whether energy and protein intakes alter the association between pulmonary function (PF) and cognition has not been studied. We made use of information from the U.S. National Health and Nutrition Examination Survey (NHANES) 2011-2012. PF measures, including forced expiratory volume in one second (FEV1), forced vital capacity (FVC), and peak expiratory flow (PEF), were calculated, whereas cognitive function was assessed through four tests: the Immediate Recall test (IRT), the Delayed Recall test (DRT), the Animal Fluency test (AFT) and the Digit Symbol Substitution test (DSST). Energy and protein intakes were measured using the 24-h dietary recall method. Weighted generalized linear regression was performed upon adjustment for covariates. Further interaction analyses were conducted to investigate the effect of energy and protein intakes on the association between PF and cognition. We finally included 803 participants aged ≥ 60years (54.4% female, weighted value). After adjusting for covariates, multiple measures (including FEV1, FVC, PEF, and composite PF) were all positively associated with better global cognition and the DSST score (P < 0.05). A stronger positive association between the DSST score and FEV1 (P for interaction = 0.001), FVC (P for interaction = 0.004), PEF (P for interaction = 0.003), and composite PF (P for interaction = 0.001) in lower energy intake. Similar results were observed in lower protein intake (all P for interaction < 0.05). Higher PF was independently associated with improved specific components of cognitive function (i.e., the DSST score). The positive association between PF and the DSST score was stronger in individuals with lower energy and protein intakes.