About 150 million families around the world are engaged in milk production. However, inflammation of the mammary gland (mastitis) remains a major problem in dairy ruminants that affects the quality of milk worldwide. The aim of this study was the examination of udder health with detection of contagious and environmental pathogens causing mastitis in 960 and 940 dairy cows and ewes, respectively. The presence of selected virulence factors such as: the formation of haemolysis, gelatinase, biofilm, hydrolyse DNA, and resistance to antibiotics with detection of methicillin resistance gene (mecA), were determined in selected virulence factors associated with isolated staphylococci. These isolated staphylococci with selected virulence factors can have untoward effects on the severity of mastitis. The results of our study indicated that, in addition to the major udder pathogens (S. aureus, S. uberis, and S. agalactiae) causing mastitis, non-aureus staphylococci (NAS), is a major risk to dairy cows and ewes. NAS, such as S. chromogenes, S. warneri, and S. xylosus isolated from infected animals with clinical and chronic mastitis, had the highest representation of virulence factors in comparison to less virulent strains. In addition, the isolates of S. aureus and NAS demonstrated 77.0 % and 44.2 % resistance to one or more antimicrobial classes from mastitic milk samples obtained from dairy cows and ewes, respectively. Due to the high resistance to β-lactamantibiotics in two isolates of S. aureus and two species of NAS isolated from cows’ mastitic milk samples, the presence of a methicillin-resistant gene mecA poses serious complications for the treatment and a serious health risk to milk consumers.