Elucidating the relationships between antimicrobial resistance and virulence is key to understanding the evolution and population dynamics of resistant pathogens. Here, we show that the susceptibility of the gram-positive bacterium Listeria monocytogenes to the antibiotic fosfomycin is a complex trait involving interactions between resistance and virulence genes and the environment. We found that a FosX enzyme encoded in the listerial core genome confers intrinsic fosfomycin resistance to both pathogenic and non-pathogenic Listeria spp. However, in the genomic context of the pathogenic L. monocytogenes, FosX-mediated resistance is epistatically suppressed by two members of the PrfA virulence regulon, hpt and prfA, which upon activation by host signals induce increased fosfomycin influx into the bacterial cell. Consequently, in infection conditions, most L. monocytogenes isolates become susceptible to fosfomycin despite possessing a gene that confers high-level resistance to the drug. Our study establishes the molecular basis of an epistatic interaction between virulence and resistance genes controlling bacterial susceptibility to an antibiotic. The reported findings provide the rationale for the introduction of fosfomycin in the treatment of Listeria infections even though these bacteria are intrinsically resistant to the antibiotic in vitro.