Sexually transmissible enteric infections (STEIs) are commonly associated with transmission among men who have sex with men (MSM). In the past decade, the UK has experienced multiple parallel STEI emergences in MSM caused by a range of bacterial species of the genus Shigella, and an outbreak of an uncommon serotype (O117 : H7) of Shiga-toxin-producing Escherichia coli (STEC). Here, we used microbial genomics on 6 outbreak and 30 sporadic STEC O117 : H7 isolates to explore the origins and pathogenic drivers of the STEC O117 : H7 emergence in MSM. Using genomic epidemiology, we found that the STEC O117 : H7 outbreak lineage was potentially imported from Latin America and likely continues to circulate both in the UK MSM population and in Latin America. We found genomic relationships consistent with existing symptomatic evidence for chronic infection with this STEC serotype. Comparative genomic analysis indicated the existence of a novel Shiga toxin 1-encoding prophage in the outbreak isolates, and evidence of horizontal gene exchange among the STEC O117 : H7 outbreak lineage and other enteric pathogens. There was no evidence of increased virulence in the outbreak strains relative to contextual isolates, but the outbreak lineage was associated with azithromycin resistance. Comparing these findings with similar genomic investigations of emerging MSM-associated Shigella in the UK highlighted many parallels, the most striking of which was the importance of the azithromycin phenotype for STEI emergence in this patient group.