This study aimed to evaluate how the surrounding vegetation affects the assemblage of fruit flies. For this, flies were collected in guava orchards with distinct types of surrounding vegetation (exotic pasture, native forest and fruit tree intercropping). The experiment was conducted in Itaporã and Dourados, State of Mato Grosso do Sul, Brazil. Weekly samples were collected from March to April 2015. McPhail traps were baited with 5% hydrolyzed corn protein. Species richness, diversity index and abundance were evaluated for each orchard, as well as the species composition of fruit fly between the environments surrounding the orchard and, finally, the sex ratio. A total of 579 individuals were collected of the species Anastrepha fraterculus, A. montei, A. obliqua, A. sororcula, A. striata, A. turpiniae and A. zenildae. The orchard surrounded by native forest had the highest species richness and Shannon diversity. The species composition differed between environments, with the formation of three distinct groups. The environment surrounding the guava orchard influences the richness, diversity, abundance and sex ratio of fruit flies, indicating that the native forest may provide more resources for the maintenance of these insects.