ABSTRACT: The structure and function of fungal communities in the coffee rhizosphere are influenced by crop environment. Because coffee can be grown along a management continuum from conventional application of pesticides and fertilizers in full sun to organic management in a shaded understory, we used coffee fields to hold host constant while comparing rhizosphere fungal communities under markedly different environmental conditions with regard to shade and inputs. We characterized the shade and soil environment in 25 fields under conventional, organic, or transitional management in two regions of Costa Rica. We amplified the internal transcribed spacer 2 (ITS2) region of fungal DNA from coffee roots in these fields and characterized the rhizosphere fungal community via high-throughput sequencing. Sequences were assigned to guilds to determine differences in functional diversity and trophic structure among coffee field environments. Organic fields had more shade, a greater richness of shade tree species, and more leaf litter and were less acidic, with lower soil nitrate availability and higher soil copper, calcium, and magnesium availability than conventionally managed fields, although differences between organic and conventionally managed fields in shade and calcium and magnesium availability depended on region. Differences in richness and community composition of rhizosphere fungi between organic and conventionally managed fields were also correlated with shade, soil acidity, and nitrate and copper availability. Trophic structure differed with coffee field management. Saprotrophs, plant pathogens, and mycoparasites were more diverse, and plant pathogens were more abundant, in organic than in conventionally managed fields, while saprotroph-plant pathogens were more abundant in conventionally managed fields. These differences reflected environmental differences and depended on region.IMPORTANCE Rhizosphere fungi play key roles in ecosystems as nutrient cyclers, pathogens, and mutualists, yet little is currently known about which environmental factors and how agricultural management may influence rhizosphere fungal communities and their functional diversity. This field study of the coffee agroecosystem suggests that organic management not only fosters a greater overall diversity of fungi, but it also maintains a greater richness of saprotrophic, plant-pathogenic, and mycoparasitic fungi that has implications for the efficiency of nutrient cycling and regulation of plant pathogen populations in agricultural systems. As well as influencing community composition and richness of rhizosphere fungi, shade management and use of fungicides and synthetic fertilizers altered the trophic structure of the coffee agroecosystem.