Responses of the opiine larval parasitoid Diachasmimorpha tryoni (Cameron) to the fruit-feeding Mediterranean fruit fly, Ceratitis capitata (Wiedemann), and the gall-forming lantana gall fly, Eutreta xanthochaeta Aldrich, were evaluated in greenhouse and open-door laboratory cages. In greenhouse cages, coffee plants containing C. capitata-infested fruit and lantana twigs containing E. xanthochaeta galls were presented to gravid D. tryoni under both choice and no-choice conditions. Regardless of the type of assay, D. tryoni strongly preferred landing on infested coffee plants to landing on galled lantana twigs. The wasp also strongly preferred landing on C. capitata-infested coffee fruits to E. xanthochaeta galls. In addition, when released directly onto a host-habitat complex, parasitoids had significantly stronger probing responses to C. capitata-infested coffee fruit than to E. xanthochaeta galls. However, the stronger probing response to coffee (shorter latency and longer duration) by D. tryoni did not result in higher rates of attack on C. capitata larvae than on gall fly larvae. When measured by the number of host larvae attacked per unit time spent probing, D. tryoni was significantly more efficient in attacking lantana gall fly larvae in stem galls than C. capitata larvae in coffee berries. When lantana patches containing galls were presented to D. tryoni in open-door laboratory cages under different regimes of availability of C. capitata or its fruit hosts, rates of attack on lantana gall flies by D. tryoni were significantly reduced by the presence of coffee plants containing C. capitata-infested berries. This result suggests that host switching of D. tryoni from C. capitata to lantana gall fly in the field is likely to be affected by the spatial and temporal distributions of the two hosts and their plant habitats. Relevance of our findings to host-switching of D. tryoni and the risk of significantly impacting populations of nontarget lantana gall flies are discussed.