Objective: To examine the epidemiology, primary care burden and treatment of atrial fibrillation (AF). Design: Cross-sectional data from primary care practices participating in the Scottish Continuous Morbidity Recording scheme between April 2001 and March 2002. Setting: 55 primary care practices (362 155 patients). Participants: 3135 patients with AF. Results: The prevalence of AF in Scotland was 9.4/1000 in men and 7.9/1000 in women (p<0.001) and increased with age (to 71/1000 in individuals aged >85 years). The prevalence of AF decreased with increasing socioeconomic deprivation (9.2/1000 least deprived and 7.5/1000 most deprived category, p = 0.02 for trend). 71% of patients with AF received rate-controlling medication: β-blocker 28%, rate-limiting calcium-channel blocker 42% and digoxin 43%. 42% of patients received warfarin, 44% received aspirin and 78% receeved more than one of these. Multivariable analysis showed that men and women aged ≥75 years were more likely (than those aged <75 years) to be prescribed digoxin (men OR 1.41, 95% CI .14 to 1.74; women OR 1.88, 95% CI 1.50 to 2.37) and aspirin (2.04, 1.66 to 2.51; 1.79, 1.42 to 2.25) and less likely to receive an antiarrhythmic drug (0.62, 0.48 to 0.81; 0.52, 0.39 to 0.70) or warfarin (0.74, 0.60 to 0.91; 0.58, 0.46 to 0.73). Adjusted analysis showed no socioeconomic gradient in prescribing. Conclusions: AF is a common condition, more so in men than in women. Deprived individuals are less likely to have AF, a finding raising concerns about socioeconomic gradients in detection and prognosis. Recommended treatments for AF were underused in women and older people. This is of particular concern, given the current trends in population demographics and the evidence that both groups are at higher risk of stroke.