We aimed at analysing the risk of congestive heart failure (CHF) among first- and second-generation immigrants in younger age groups. All individuals aged 18-54years, n=3973454 in the first-generation study and n=3817560 in the second-generation study, were included. CHF was defined as at least one registered diagnosis in the National Patient Register between 1 January 1998 and 31 December 2018. Cox regression analysis was used to estimate the relative risk [hazard ratios (HRs) with 99% confidence intervals (CIs)] of incident CHF with adjustments for age, co-morbidities and socio-demographics. In the first-generation study, a total of 85719 cases of CHF were registered, 54369 men and 31350 women, where fully adjusted models showed HRs for all foreign-born men of 1.12 (99% CI 1.06-1.17) and for women of 0.99 (0.92-1.05). Groups with higher risk included men from Eastern Europe, Central Europe, Africa and Asia and women from Africa and Asia, and a lower risk was found among Latin American women. In the second-generation study, a total of 88999 cases of CHF were registered, 58403 men and 30596 women, where fully adjusted models showed HRs for second-generation men of 1.04 (0.99-1.09) and women of 0.97 (0.90-1.04). The higher risk in some foreign-born groups needs to be paid attention to in clinical practice. The fact that almost all increased risks were attenuated and absent in second-generation immigrants suggests that lifestyle and environmental factors are more important than genetic differences in the risk of CHF.