Background: It is unknown whether screening for atrial fibrillation and subsequent treatment with anticoagulants if atrial fibrillation is detected can prevent stroke. Continuous electrocardiographic monitoring using an implantable loop recorder (ILR) can facilitate detection of asymptomatic atrial fibrillation episodes. We aimed to investigate whether atrial fibrillation screening and use of anticoagulants can prevent stroke in individuals at high risk. Methods: We did a randomised controlled trial in four centres in Denmark. We included individuals without atrial fibrillation, aged 70–90 years, with at least one additional stroke risk factor (ie, hypertension, diabetes, previous stroke, or heart failure). Participants were randomly assigned in a 1:3 ratio to ILR monitoring or usual care (control) via an online system in permuted blocks with block sizes of four or eight participants stratified according to centre. In the ILR group, anticoagulation was recommended if atrial fibrillation episodes lasted 6 min or longer. The primary outcome was time to first stroke or systemic arterial embolism. This study is registered with ClinicalTrials.gov, NCT02036450. Findings: From Jan 31, 2014, to May 17, 2016, 6205 individuals were screened for inclusion, of whom 6004 were included and randomly assigned: 1501 (25·0%) to ILR monitoring and 4503 (75·0%) to usual care. Mean age was 74·7 years (SD 4·1), 2837 (47·3%) were women, and 5444 (90·7%) had hypertension. No participants were lost to follow-up. During a median follow-up of 64·5 months (IQR 59·3–69·8), atrial fibrillation was diagnosed in 1027 participants: 477 (31·8%) of 1501 in the ILR group versus 550 (12·2%) of 4503 in the control group (hazard ratio [HR] 3·17 [95% CI 2·81–3·59]; p<0·0001). Oral anticoagulation was initiated in 1036 participants: 445 (29·7%) in the ILR group versus 591 (13·1%) in the control group (HR 2·72 [95% CI 2·41–3·08]; p<0·0001), and the primary outcome occurred in 318 participants (315 stroke, three systemic arterial embolism): 67 (4·5%) in the ILR group versus 251 (5·6%) in the control group (HR 0·80 [95% CI 0·61–1·05]; p=0·11). Major bleeding occurred in 221 participants: 65 (4·3%) in the ILR group versus 156 (3·5%) in the control group (HR 1·26 [95% CI 0·95–1·69]; p=0·11). Interpretation: In individuals with stroke risk factors, ILR screening resulted in a three-times increase in atrial fibrillation detection and anticoagulation initiation but no significant reduction in the risk of stroke or systemic arterial embolism. These findings might imply that not all atrial fibrillation is worth screening for, and not all screen-detected atrial fibrillation merits anticoagulation. Funding: Innovation Fund Denmark, The Research Foundation for the Capital Region of Denmark, The Danish Heart Foundation, Aalborg University Talent Management Program, Arvid Nilssons Fond, Skibsreder Per Henriksen, R og Hustrus Fond, The AFFECT-EU Consortium (EU Horizon 2020), Læge Sophus Carl Emil Friis og hustru Olga Doris Friis' Legat, and Medtronic.