Comparative genomics were used to assess genetic differences between Staphylococcus aureus strains derived from infected animals versus colonized or infected humans. A total of 77 veterinary isolates were genetically characterized by high-throughput amplified fragment length polymorphism (AFLP). Bacterial genotypes were introduced in a large AFLP database containing similar information for 1,056 human S. aureus strains. All S. aureus strains isolated from animals in close contact with humans (e.g., pet animals) were predominantly classified in one of the five main clusters of the AFLP database (cluster I). In essence, mastitis-associated strains from animals were categorized separately (cluster IVa) and cosegregated with bacteremia-associated strains from humans. Distribution of only 2 out of 10 different virulence genes differed across the clusters. The gene encoding the toxic shock syndrome protein (tst) was more often encountered among veterinary strains (P < 0.0001) and even more in the mastitis-related strains (P<0.0001) compared to human isolate results. The gene encoding the collagen binding protein (cna) was rarely detected among invasive human strains. The virulence potential, as indicated by the number of virulence genes per strain, did not differ significantly between the human- and animal-related strains. Our data show that invasive infections in pets and humans are usually due to S. aureus strains with the same genetic background. Mastitis-associated S. aureus isolated in diverse farm animal species form a distinct genetic cluster, characterized by an overrepresentation of the toxic shock syndrome toxin superantigen-encoding gene.