Q fever is a zoonotic infection which can pose a danger to pregnant women. To our knowledge, Denmark has never experienced a clinically verified Q fever outbreak. We aimed to quantify risk of infection in pregnant women occupationally and environmentally exposed to Coxiella burnetii. The Danish National Birth Cohort collected blood samples from 100,418 pregnant women in the period 1996 to 2002. We sampled 195 women with occupational exposure to livestock (veterinarians and female farmers), 202 women with domestic exposure (dairy cattle and/or sheep) and a random sample of 459 unexposed women. Samples were screened for antibodies against C. burnetii by commercial enzyme-linked immunosorbent assay. Positive samples were confirmed by immunofluorescence (cut-off titre ≥1:128). The proportion of seropositive women was higher in the occupationally exposed (47.2% seropositive; relative risk (RR): 9.8; 95% confidence interval (CI): 6.4–15.2) and the domestically exposed population (32.2% seropositive; RR: 6.7; 95% CI: 4.3–10.6) than in unexposed women (4.8% seropositive). We found a high prevalence of antibodies to C. burnetii among pregnant women with occupational or domestic exposure to cattle and/or sheep compared with unexposed pregnant women. Our findings suggest that contact to livestock is a risk factor for C. burnetii infection in Denmark.