By causing extinctions and altering community structure, anthropogenic disturbances can disrupt processes that maintain ecosystem integrity. However, the relationship between community structure and ecosystem functioning in natural systems is poorly understood. Here we show that habitat loss appeared to disrupt ecosystem functioning by affecting extinction order, species richness and abundance. We studied pollination by bees in a mosaic of agricultural and natural habitats in California and dung burial by dung beetles on recently created islands in Venezuela. We found that large-bodied bee and beetle species tended to be both most extinction-prone and most functionally efficient, contributing to rapid functional loss. Simulations confirmed that extinction order led to greater disruption of function than predicted by random species loss. Total abundance declined with richness and also appeared to contribute to loss of function. We demonstrate conceptually and empirically how the non-random response of communities to disturbance can have unexpectedly large functional consequences.