The factors affecting the mortality of cows in Danish dairy herds were investigated by analysing data from 6839 herds. The mean risk of mortality during the first 100 days of lactation was 2·5 per cent. The risk of mortality increased with increasing herd size (odds ratio [OR] 1·05 for an increase in herd size of 50 cows), with the proportion of purchased cows (OR 1·05 for an increase in the proportion of purchased cows of 0·1), and with increases in the somatic cell count (OR 1·16 for an increase in average weighted mean somatic cell count of 100,000 cells/ml). The risk decreased with increasing average milk yield per cow (OR 0·93 for an increase in mean yield per cow-year of 1000 kg). The risk was lower in free-stall barns with deep litter (OR 0·79) than in barns with cubicles (OR 1) or tie-stalls (OR 1·04). Herds with Danish Holstein (OR 1) or Danish Jersey (OR 0·93) cows as the predominant breed had a higher risk of mortality than herds of the Danish red dairy breed (OR 0·67). The risk of mortality was lower in organic herds (OR 1) than in conventional herds (OR 1·17), and lower in herds that grazed pasture during the summer (OR 0·78).