The emergence and dissemination of antimicrobial resistant pathogens have led to rising concern about the widespread and excessive use of antimicrobials in veterinary medicine. Denmark has implemented several initiatives to reduce antimicrobial use in animals since the 90s, with the Yellow Card scheme implemented in 2010. The aim of the present study is to investigate the effects on antimicrobial use in Danish pig farms of changes in the legislation regarding the Yellow Card, based on analysis of temporal trends in monthly antimicrobial consumption calculated at herd-level from 2010 to 2017. A dynamic linear model with a linear growth component was used to model the data. The percentage of herds with a negative growth component and a significant decline below zero (based on 95% credible intervals) was assessed for the entire study period. The analysis was run separately for the different age groups within each farm: weaners (up to 30 kg), sows and finishers herds, and categorized according to antimicrobial use before the Yellow Card initiative (2008-2009), as groups of herds with "low," "moderate," or "high" consumption. The results evidence a decline of the antimicrobial consumption in Danish pig herds, more pronounced during two periods: with the introduction of the Yellow Card and in relation to the announcements and changes in the legislation in 2014. Weaner herds in the high consumption category had the highest percentage of herds with a negative growth component, reaching 82% of herds in January 2011, followed by weaner herds with moderate antimicrobial consumption reaching 71% of herds in October 2012. For finisher herds in the moderate consumption category, the proportion with a negative growth increased from 38% in January 2010 to 71% in July 2011. A decline in antimicrobial consumption was also evident after announcements and changes in the legislation in 2014, particularly for sows and finishers. Our findings suggest that changes in the Yellow Card scheme promoted a continuous reduction in antimicrobial use in Danish pig herds, particularly in herds with high antimicrobial consumption.