Twelve isolates from the genus Agaricus (Fungi, Basidiomycota) were investigated for their ability to support development of the phorid fly, Megaselia halterata (Wood), which is an important pest of the commercial white button mushroom Agaricus bisporus. Combined effects of oviposition of adult female M. halterata and larval development in mushroom compost inoculated with Agaricus mycelium were determined using bioassays. The numbers of M. halterata offspring that developed were affected by the Agaricus isolate used, and there was a significant separation between resistant and susceptible isolates. In a bioassay where the female phorids had a choice of all 12 isolates for oviposition, three isolates produced >200 adults per 100 g compost pot while the remaining nine isolates had <20 adults per pot. Where there was no choice of Agaricus isolate for oviposition, five isolates resulted in >100 adults per 100 g compost pot while the remainder resulted in <4 adults per pot. With the susceptible isolates, there was a positive correlation between increasing concentration of mycelium in the substrate and phorid development until the concentration exceeded 40% after which numbers of emerging phorids declined. Genetic identity of Agaricus isolates was determined using ITS sequencing and phylogenetic methods, which revealed two major cluster groups. Isolates supporting the development of large populations of M. halterata were located in one of these clusters (group I), and were either Agaricus bisporus or other species from the same Agaricus section Duploannulatae. Isolates that did not support the development of M. halterata populations were located in a different cluster (group II) and were more genetically distant from A. bisporus, e.g. Agaricus sections Arvenses, Minores and Xanthodermatei. Species of Agaricus with resistance to M. halterata could have significant potential for the breeding and cultivation of phorid-free mushrooms.