The genetic diversity of Cryptosporidium spp. and Giardia duodenalis from dairy cattle and pigs in Denmark was determined in the present study. Faecal samples from 1237 pigs and 1150 cattle originating from 50 sow herds and 50 dairy herds, respectively, were analysed for the presence of the two parasites by immunofluorescence microscopy. A large proportion of the (oo)cyst containing samples were selected for molecular characterization. Sequencing and phylogenetic analysis of the 18S rDNA locus and/or the HSP70 gene of 183 pig and 154 cattle isolates of Cryptosporidium revealed the presence of C. suis, pig genotype II, C. parvum (cattle genotype), C. bovis, Cryptosporidium deer-like genotype and a novel C. suis-like genotype. For both cattle and pigs, a host age-related change in distribution of species/genotypes was observed. The zoonotic C. parvum (cattle genotype) was most prevalent in young calves. For Giardia, 82 and 145 isolates from pigs and cattle, respectively, were analysed at the 18S rDNA locus and/or the gdh gene. Giardia isolates belonging to the zoonotic Assemblage A was found in both young and older calves, as well as in weaners and piglets, whereas cows seemed to be infected purely by isolates of the livestock group, Assemblage E.