Udder diseases (mastitis) are a serious cause of economic losses in sheep breeding as they have a negative impact on lamb rearing and the quality of dairy products. So far the progress in treatment and prevention of these diseases has been insufficient, giving ground for searching possibilities of using natural immunity to combat mastitis. The aim of the study was to assess the relationship between the microsatellite polymorphism of selected Ovar-MHC genes and the health status of the mammary gland of sheep. The research was carried out on sheep of the Polish Heath and Polish Lowland breeds. In ovine milk the number of somatic cells (SCC) and the percentage of the lymphocyte subpopulation were assessed. On the basis of genomic DNA, molecular analysis of the Ovar-MHC gene fragments (OLADRB1, OLADRB2, OMHC1) polymorphism was performed. Significant differences were found in SCC and the percentage of lymphocytes (CD4, CD8, CD19) in the milk depending on the alleles of the Ovar-MHC genes. Alleles of 488 bp (DRB1) and 284 bp (DRB2) were found more frequently in sheep with healthy udders, while carriers of the 508 bp (DRB1) and 272 bp (DRB2) alleles were more prone to subclinical mastitis. The obtained results justify the need for further research in order to better understanding the genetic basis of mastistis and to search for effective molecular markers that can be used in breeding practice.