Streptococcus agalactiae, also known as group B Streptococcus (GBS), is a pathogen of humans and animals. It is an important cause of mastitis in dairy cattle, causing decreased milk quality and quantity. Denmark is the only country to have implemented a national surveillance and control campaign for GBS in dairy cattle. After a significant decline in the 20th century, prevalence has increased in the 21st century. Using a unique combination of national surveillance, cattle movement data and molecular typing, we tested the hypothesis that transmission mechanisms differ between GBS strains that are almost exclusive to cattle and those that affect humans as well as cattle, which would have implications for control recommendations. Three types of S. agalactiae, sequence type (ST) 1, ST23 and ST103 were consistently the most frequent strains among isolates obtained through the national surveillance programme from 2009 to 2011. Herds infected with ST103, which is common in cattle but rarely found in people in Europe, were spatially clustered throughout the study period and across spatial scales. By contrast, strains that are also commonly found in humans, ST1 and ST23, showed no spatial clustering in most or any years of the study, respectively. Introduction of cattle from a positive herd was associated with increased risk of infection by S. agalactiae in the next year (risk ratio of 2.9 and 4.7 for 2009-2010 and 2010-2011, respectively). Moreover, mean exposure to infection was significantly higher for newly infected herds and significantly lower for persistently susceptible herds, as compared to random simulated networks with the same properties, which suggests strong association between the cattle movement network and new infections. At strain-level, new infections with ST1 between 2009 and 2010 were significantly associated with cattle movements, while other strains showed only some degree of association. Sharing of veterinary services, which may serve as proxy for local or regional contacts at a range of scales, was not significantly associated with increased risk of introduction of S. agalactiae or one of the three predominant strains on a farm. Our findings support the reinstatement of restrictions on cattle movements from S. agalactiae positive herds, which came into effect in 2018, but provide insufficient evidence to support strain-specific control recommendations.