Methods and resultsWe included all Swedish patients who had been diagnosed with AF in a hospital or in a hospital-associated outpatient unit between 1 July 2005 and 1 October 2017. Patients with active cancer (n = 22 596) and without cancer (n = 440 848) were propensity score matched for the likelihood of receiving OACs at baseline. At baseline, 38.3% of cancer patients with AF and high stroke risk according to CHA2DS2-VASc score received OACs. There was a net benefit of OACs, assessed by the composite outcome of ischaemic stroke, extracranial arterial thromboembolism, all major bleedings, and death, both among patients with active cancer [hazard ratio (HR): 0.81, confidence interval (CI): 0.78–0.85] and among patients without cancer (HR: 0.81, CI: 0.80–0.82). When limiting follow-up to 1 year to minimize the effects of possible treatment cross-over and additionally accounting for death as a competing risk in cancer patients, a net cerebrovascular benefit regarding ischaemic stroke or intracranial bleeding was observed for OACs [subhazard ratio (sHR): 0.67, CI: 0.55–0.83]. A net cerebrovascular benefit was also seen for non-vitamin K antagonist OACs over warfarin after competing risk analyses in cancer patients (sHR: 0.65, CI: 0.48–0.88).