1. The loss of a species from an ecological community can trigger a cascade of secondary extinctions. Here we investigate how the complexity (connectance) of model communities affects their response to species loss. Using dynamic analysis based on a global criterion of persistence (permanence) and topological analysis we investigate the extent of secondary extinctions following the loss of different kinds of species. 2. We show that complex communities are, on average, more resistant to species loss than simple communities: the number of secondary extinctions decreases with increasing connectance. However, complex communities are more vulnerable to loss of top predators than simple communities. 3. The loss of highly connected species (species with many links to other species) and species at low trophic levels triggers, on average, the largest number of secondary extinctions. The effect of the connectivity of a species is strongest in webs with low connectance. 4. Most secondary extinctions are due to direct bottom-up effects: consumers go extinct when their resources are lost. Secondary extinctions due to trophic cascades and disruption of predator-mediated coexistence also occur. Secondary extinctions due to disruption of predator-mediated coexistence are more common in complex communities than in simple communities, while bottom-up and top-down extinction cascades are more common in simple communities. 5. Topological analysis of the response of communities to species loss always predicts a lower number of secondary extinctions than dynamic analysis, especially in food webs with high connectance.