Malnutrition (synonym: undernutrition) is prevalent among older adults, which may be partly related to changes in dietary intake, but evidence on the link between malnutrition and diet is scarce. The aims of this study were to estimate the association between energy/nutrients intake and malnutrition, and to characterise nutritional inadequacy in institutionalised and non-institutionalised older adults. A national survey was conducted including a Portuguese representative sample of nursing home (NH) residents (n 563) and community-dwellers (n 837) aged ≥ 65 years. Data included socio-demographic characteristics, self-reported health, loneliness feelings, nutritional status (Mini Nutritional Assessment®) and dietary intake (two non-consecutive 24-h recalls). A higher energy intake was associated with lower odds of malnutrition risk (being ‘at risk of malnutrition’ or ‘malnourished’) in both settings, but only significant among NH residents after adjusting for confounders (NH: OR = 0·66, 95 % CI 0·50, 0·86; community: OR = 0·64, 95 % CI 0·37, 1·10). The intake of carbohydrates, fat, fibre, vitamin C, Na, K and Mg was inversely associated with malnutrition risk in NH residents, and protein, fat, vitamin B6, folates, Na, K, Ca and Mg intake in community-dwellers. After additional adjustment for total energy, only Na and Mg intake of community-dwellers remained significantly associated. The prevalence of inadequate nutrient intake was generally higher for the malnutrition risk group, which was particularly evident among community-dwellers. The effect of dietary intake on nutritional status seems more dependent on total energy and carbohydrates intake in institutionalised elders, whereas among community-dwellers protein and some micronutrients appear to have a greater impact.