The gut is a first point of contact with ingested xeno- biotics, where chemicals are metabolized directly by the host or microbiota. Atrazine is a widely used pesticide, but the role of the microbiome metabolism of this xenobiotic and the impact on host responses is unclear. We exposed successive generations of the wasp Nasonia vitripennis to subtoxic levels of atrazine and observed changes in the structure and function of the gut microbiome that conveyed atra- zine resistance. This microbiome-mediated resis- tance was maternally inherited and increased over successive generations, while also heightening the rate of host genome selection. The rare gut bacteria Serratia marcescens and Pseudomonas protegens contributed to atrazine metabolism. Both of these bacteria contain genes that are linked to atrazine degradation and were sufficient to confer resistance in experimental wasp populations. Thus, pesticide exposure causes functional, inherited changes in the microbiome that should be considered when as- sessing xenobiotic exposure and as potential coun- termeasures to toxicity.