Vegetation is one of the main factors affecting the composition and structure of ant communities. The effect of vegetation is both by offering food resources and by modifying the proportion of ground cover exposed to shade conditions. However, it is difficult in field studies to uncouple the effects of food resources and shade on animal communities. The goal of this study was to analyze experimentally the effects of vegetation through food and shade supply on the structure and composition of a Mediterranean ant community. We have crossed these two factors in a factorial design where we have eliminated vegetation in experimental treatments and we have simulated the effects of vegetation by manipulating separately the supply of food resources and shade. The expected decrease in ant abundance and richness in plots without food resources but with shade was only partially confirmed by the results, because there was a decrease in the number of ant species but not a significant decrease in overall ant abundance in plots without food resources. We did not confirm the second hypothesis that the decrease in shade while maintaining food resources resulted in an increase of heat-tolerant, subordinate species and, consequently, ant richness. Species composition differed in the different experimental treatments. Stress-tolerant species were abundant in areas without shade and without food resources. Heat-tolerant species were mainly present in plots without shade but with food resources. Finally, species with high requirements of shade and/or food resources were associated to control plots with both shade and food resources from vegetation. Overall, this study provides an experiment that uncouples experimentally shade and food resources and dissects their effects on the whole ant community, and shows that the effects of the two factors are independent and affect different components of ant community structure and composition. Copyright © Ecography 2007.