Staphylococcus aureus is one of the most common pathogens responsible for contagious mastitis in ruminants. The ability of S. aureus to form biofilm in vivo is considered to be a major virulence factor influencing its pathogenesis in mastitis. The objectives of the study were to examine in vitro slime production, biofilm formation, and the presence of the ica gene locus and icaA and icaD genes in S. aureus isolates from bovine mastitis. Thirty-two of the 35 isolates tested produced slime on Congo red agar, whereas only 24 of the isolates were found to produce biofilm in vitro. However, all the 35 isolates possessed the ica locus, icaA and icaD genes. This study indicates a high prevalence of the ica genes among S. aureus mastitis isolates, and their presence is not always associated with in vitro formation of slime or biofilm. A combination of phenotypic and genotypic tests is recommended for investigating biofilm formation in S. aureus.