Global amphibian declines have often been attributed to disease, but ignorance of the relative importance and mode of action of potential drivers of infection has made it difficult to develop effective remediation. In a field study, here we show that the widely used herbicide, atrazine, was the best predictor (out of more than 240 plausible candidates) of the abundance of larval trematodes (parasitic flatworms) in the declining northern leopard frog Rana pipiens. The effects of atrazine were consistent across trematode taxa. The combination of atrazine and phosphate--principal agrochemicals in global corn and sorghum production--accounted for 74% of the variation in the abundance of these often debilitating larval trematodes (atrazine alone accounted for 51%). Analysis of field data supported a causal mechanism whereby both agrochemicals increase exposure and susceptibility to larval trematodes by augmenting snail intermediate hosts and suppressing amphibian immunity. A mesocosm experiment demonstrated that, relative to control tanks, atrazine tanks had immunosuppressed tadpoles, had significantly more attached algae and snails, and had tadpoles with elevated trematode loads, further supporting a causal relationship between atrazine and elevated trematode infections in amphibians. These results raise concerns about the role of atrazine and phosphate in amphibian declines, and illustrate the value of quantifying the relative importance of several possible drivers of disease risk while determining the mechanisms by which they facilitate disease emergence.