Staphylococcus aureus clonal complex 398 (CC398) is associated with disease in humans and livestock, and its origins and transmission have generated considerable interest. We performed a time-scaled phylogenetic analysis of CC398, including sequenced isolates from the United Kingdom (Scotland), along with publicly available genomes. Using state-of-the-art methods for mapping traits onto phylogenies, we quantified transitions between host species to identify sink and source populations for CC398 and employed a novel approach to investigate the gain and loss of antibiotic resistance in CC398 over time. We identified distinct human- and livestock-associated CC398 clades and observed multiple transmissions of CC398 from livestock to humans and between countries, lending quantitative support to previous reports. Of note, we identified a subclade within the livestock-associated clade comprised of isolates from hospital environments and newborn babies, suggesting that livestock-associated CC398 is capable of onward transmission in hospitals. In addition, our analysis revealed significant differences in the dynamics of resistance to methicillin and tetracycline related to contrasting historical patterns of antibiotic usage between the livestock industry and human medicine. We also identified significant differences in patterns of gain and loss of different tetracycline resistance determinants, which we ascribe to epistatic interactions between the resistance genes and/or differences in the modes of inheritance of the resistance determinants.