Streptococcus agalactiae is one of the most common pathogens leading to mastitis in dairy herds worldwide; consequently, the pathogen causes major economic losses for affected farmers. In this study, multilocus sequence typing (MLST), genotypic capsular typing by multiplex polymerase chain reaction (PCR), and virulence gene detection were performed to address the molecular epidemiology of 59 bovine (mastitis) S. agalactiae isolates from 36 dairy farms located in the largest milk-producing mesoregions in Brazil (Minas Gerais, São Paulo, Paraná, and Pernambuco). We screened for the virulence genes bac, bca, bibA, cfb, hylB, fbsA, fbsB, PI-1, PI-2a, and PI-2b, which are associated with adhesion, invasion, tissue damage, and/or immune evasion. Furthermore, five capsular types were identified (Ia, Ib, II, III, and IV), and a few isolates were classified as non-typeable (NT). MLST revealed the following eight sequence types (STs): ST-61, ST-67, ST-103, ST-146, ST-226, ST-314, and ST-570, which were clustered in five clonal complexes (CC64, CC67, CC103, CC17, and CC314), and one singleton, ST-91. Among the virulence genes screened in this study, PI-2b, fbsB, cfb, and hylB appear to be the most important during mastitis development in cattle. Collectively, these results establish the molecular epidemiology of S. agalactiae isolated from cows in Brazilian herds. We believe that the data presented here provide a foundation for future research aimed at developing and implementing new preventative and treatment options for mastitis caused by S. agalactiae.