Abstract Background Heart failure (HF) and cancer represent prevalent chronic conditions with a high burden of disease worldwide. Several studies have shown a high frequency of coexistence of these two entities, highlighting a potential bidirectional association. However, few longitudinal studies have explored whether patients with HF have a significantly increased risk of cancer and if comorbidity profiles affect this risk. Purpose To explore the association between incident HF diagnosis and cancer development in UK Biobank participants after adjustment by potential confounders. Methods We conducted a retrospective cohort study in UK Biobank. HF and cancer diagnoses were determined using diagnoses and patient reports. We evaluated breast, liver, lung, prostate, colorectal, uterus, and hematological cancer. Individuals with a history of HF or cancer diagnosed before the baseline assessment were excluded. The primary exposure was incident HF diagnosis after enrollment, and the primary outcome was incident cancer during follow-up. Multivariate Cox proportional hazard regression models using time-varying covariates were used to calculate hazard ratios (HR) for the explored associations with overall cancer and by major cancer type. A Bonferroni-corrected p-value < 0.003 was considered statistically significant to control for family-wise error rate. Results 476,652 patients were analyzed (mean age: 56.3 years; 57.8% females). Over a median follow-up of 13.7 years, 12,461 (2.6%) developed HF, and 34,452 (7.2%) were diagnosed with cancer. Incident HF was significantly associated with increased overall cancer risk (HR 1.34, 95% CI 1.22–1.48. p<0.001), as well as lung (HR 1.30, 95% CI 1.18–1.43), and hematological cancers (HR 1.54, 95% CI 1.25–1.91. p<0.001) (Figure). Conclusion Despite sharing multiple comorbidities and risk factors, incident HF remained significantly associated with a higher cancer risk even after multivariable adjustment by relevant confounders. Nevertheless, confounding bias and especially detection bias, cannot be ruled out in the present analysis. Further research is necessary to validate these findings and elucidate the mechanisms underlying this association.Figure