Virus-resistant transgenic squash are grown throughout the United States and much of Mexico and it is likely that the virus-resistant transgene (VRT) has been introduced to wild populations repeatedly. The evolutionary fate of any resistance gene in wild populations and its environmental impacts depend upon trade-offs between the costs and benefits of the resistance gene. In a 3-year field study using a wild gourd and transgenic and nontransgenic introgressives, we measured the effects of the transgene on fitness, on herbivory by cucumber beetles, on the incidence of mosaic viruses, and on the incidence of bacterial wilt disease (a fatal disease vectored by cucumber beetles). In each year, the first incidence of zucchini yellow mosaic virus occurred in mid-July and spread rapidly through the susceptible plants. We found that the transgenic plants had greater reproduction through both male and female function than the susceptible plants, indicating that the VRT has a direct fitness benefit for wild gourds under the conditions of our study. Moreover, the VRT had no effect on resistance to cucumber beetles or the incidence of wilt disease before the spread of the virus. However, as the virus spread through the fields, the cucumber beetles became increasingly concentrated upon the healthy (mostly transgenic) plants, which increased exposure to and the incidence of wilt disease on the transgenic plants. This indirect cost of the VRT (mediated by a nontarget herbivore and pathogen) mitigated the overall beneficial effect of the VRT on fitness.