Mobile genetic elements (MGEs) often carry genes that benefit their bacterial hosts. In methicillin-resistant Staphylococcus aureus (MRSA), MGEs have been associated with antibiotic resistance, virulence, and host adaptation. Clonal-complex (CC) 398 is the dominant MRSA in European livestock, and a growing cause of human infections. To understand the risk posed by livestock-associated MRSA to human health, we have used a collection of 1,180 CC398 genomes, sampled from several livestock species and humans, with a broad geographic distribution and spanning 27 years, to reconstruct the dynamics of the MGEs. We find that the emergence of livestock-associated CC398 coincided with the acquisition of a Tn916 transposon carrying a tetracycline resistance gene, which has been stably vertically inherited for 57 years. This was followed by the acquisition of a large SCCmec type V element that carries methicillin, tetracycline and heavy metal resistance genes. This has been maintained within livestock-associated CC398 for at least 35 years, with occasional truncations and replacements with other, smaller type IV SCCmec elements. In contrast, a class of prophages that carry a human immune-evasion gene cluster, that are largely absent from livestock-associated CC398, have been repeatedly gained and lost across both human- and livestock-associated CC398. The variable dynamics of these three MGEs means that when livestock-associated MRSA infects humans, re-adaptation to the human host outpaces the loss of antibiotic resistance. Moreover, the stability of both Tn916 and SCCmec suggests that they may persist despite ongoing reductions in antibiotic and zinc oxide use in farming.