We demonstrate here a widespread distribution of genes mediating efflux-based resistance to quaternary ammonium compounds (QACs) in staphylococci from unpasteurized milk from 127 dairy cattle herds and 70 dairy goat herds. QAC resistance genes were identified in 21% of the cattle herds (qacA/B, smr, qacG, and qacJ) and in 10% of the goat herds (qacA/B and smr). Further examination of 42 QAC-resistant bovine and caprine isolates revealed the following genes: qacA/B (12 isolates) was present in four different species of coagulase-negative staphylococci (CoNS), smr (27 isolates) was detected in eight different CoNS species and in Staphylococcus aureus on a previously reported plasmid (pNVH99), qacG (two isolates) was detected on two plasmids (pST94-like) in Staphylococcus cohnii and Staphylococcus warneri, and qacJ (two isolates) was found in Staphylococcus hominis and Staphylococcus delphini on a plasmid (pNVH01) previously found in equine staphylococci. Isolation of indistinguishable pulsed-field gel electrophoresis (PFGE) CoNS types from tank milk and mammary quarter milk samples in a dairy cattle herd suggested that these QAC-resistant staphylococci were of intramarnmary origin. Indistinguishable or closely related PFGE types of bovine QAC-resistant CoNS were observed in different herds. One particular bovine S. warneri PFGE type was isolated repeatedly from samples collected during a 30-month period in a herd, showing long-term persistence. In conclusion, it seems that the widespread distribution of staphylococci carrying QAC resistance genes in Norwegian dairy cattle and goat herds is the result of both the intra- and interspecies spread of QAC resistance plasmids and the clonal spread of QAC-resistant strains.