Importance Atrial fibrillation (AF) has a substantial genetic component. The importance of polygenic risk is well established, while the contribution of rare variants to disease risk warrants characterization in large cohorts. Objective To identify rare predicted loss-of-function (pLOF) variants associated with AF and elucidate their role in risk of AF, cardiomyopathy (CM), and heart failure (HF) in combination with a polygenic risk score (PRS). Design, Setting, and Participants This was a genetic association and nested case-control study. The impact of rare pLOF variants was evaluated on the risk of incident AF. HF and CM were assessed in cause-specific Cox regressions. End of follow-up was July 1, 2022. Data were analyzed from January to October 2023. The UK Biobank enrolled 502 480 individuals aged 40 to 69 years at inclusion in the United Kingdom between March 13, 2006, and October 1, 2010. UK residents of European ancestry were included. Individuals with prior diagnosis of AF were excluded from analyses of incident AF. Exposures Rare pLOF variants and an AF PRS. Main Outcomes and Measures Risk of AF and incident HF or CM prior to and subsequent to AF diagnosis. Results A total of 403 990 individuals (218 489 [54.1%] female) with a median (IQR) age of 58 (51-63) years were included; 24 447 were diagnosed with incident AF over a median (IQR) follow-up period of 13.3 (12.4-14.0) years. Rare pLOF variants in 6 genes ( TTN , RPL3L , PKP2 , CTNNA3 , KDM5B , and C10orf71 ) were associated with AF. Of these, TTN , RPL3L , PKP2 , CTNNA3 , and KDM5B replicated in an external cohort. Combined with high PRS, rare pLOF variants conferred an odds ratio of 7.08 (95% CI, 6.03-8.28) for AF. Carriers with high PRS also had a substantial 10-year risk of AF (16% in female individuals and 24% in male individuals older than 60 years). Rare pLOF variants were associated with increased risk of CM both prior to AF (hazard ratio [HR], 3.13; 95% CI, 2.24-4.36) and subsequent to AF (HR, 2.98; 95% CI, 1.89-4.69). Conclusions and Relevance Rare and common genetic variation were associated with an increased risk of AF. The findings provide insights into the genetic underpinnings of AF and may aid in future genetic risk stratification.