Methods: This observational retrospective study of primary care patients was developed with the digital ECG database from the Telehealth Network of Minas Gerais, Brazil. ECGs performed from 2010 to 2017 were interpreted by cardiologists and the University of Glasgow automated analysis software. An electronic cohort was obtained linking data from ECG exams and those from a national mortality information system, using standard probabilistic linkage methods. We considered only the first ECG of each patient. Patients under 16 years were excluded. Hazard ratios (HR) for mortality were adjusted for demographic and self-reported clinical factors and estimated with Cox regression. Results: From a dataset of 1,773,689 patients, 1,558,421 were included, mean age 51.6 years; 40.2% male. There were 3.34% deaths from all causes in 3.68 years of median follow up. The prevalence of AF was 1.33%. AF was an independent risk factor for all-cause mortality (HR 2.10, 95%CI 2.03–2.17) and cardiovascular mortality (HR 2.06, 95%CI 1.86–2.29). Females with AF had a higher risk of overall and cardiovascular mortality compared with males (p $<$ 0.001). Conclusions: AF was a strong predictor of cardiovascular and all-cause mortality in a primary care population, with increased risk in women.