Objective Our aim was to study the risk of a first ischemic stroke in patients with atrial fibrillation (AF) treated in primary health care. Design The study population included all adults (n = 11,517), 45 years and older diagnosed with AF, from 75 primary care centres in Sweden between 2001 and 2007. Ischemic stroke was defined as a hospital care event of stroke between 2001 and 2010. Association between incident stroke and warfarin treatment was explored using Cox regression analysis, with hazard ratios (HRs), and 95% confidence intervals (95% CIs). Adjustment was made for age, socioeconomic factors and co-morbidity. Results Persistent treatment with warfarin was present among 34.7% of women and 40.9% among men. Persistent warfarin treatment, compared to no persistent treatment, was associated with a stroke preventing effect with fully adjusted HRs of 0.25 (95% CI 0. 0.26-0.45) in women, and 0.25 (95% CI 0.28-0.43) in men. A CHA2DS2-VASc score of at least two among women, and three among men, was associated with a stroke risk exceeding 18% during a mean follow-up of 5.4 years. Risk of haemorrhagic stroke was not increased. Conclusions Warfarin is effective in preventing stroke in AF patients in primary health care.