Klebsiella spp. have become an important cause of clinical mastitis in dairy cows in New York State. We describe the occurrence of two Klebsiella mastitis outbreaks on a single dairy farm. Klebsiella isolates from milk, feces, and environmental sources were compared using random amplified polymorphic DNA (RAPD)-PCR typing. The first mastitis outbreak was caused by a single strain of Klebsiella pneumoniae, RAPD type A, which was detected in milk from eight cows. RAPD type A was also isolated from the rubber liners of milking machine units after milking of infected cows and from bedding in the outbreak pen. Predominance of a single strain could indicate contagious transmission of the organism or exposure of multiple cows to an environmental point source. No new cases with RAPD type A were observed after implementation of intervention measures that targeted the prevention of transmission via the milking machine as well as improvement of environmental hygiene. A second outbreak of Klebsiella mastitis that occurred several weeks later was caused by multiple RAPD types, which rules out contagious transmission and indicates opportunistic infections originating from the environment. The diversity of Klebsiella strains as quantified with Simpson's index of discrimination was significantly higher for isolates from fecal, feed, and water samples than for isolates from milk samples. Several isolates from bedding material that had the phenotypic appearance of Klebsiella spp. were identified as being Raoultella planticola and Raoultella terrigena based on rpoB sequencing.