Spatial structure can have a profound, but often underappreciated, effect on the temporal dynamics of ecosystems. Here we report on a counterintuitive increase in the population of a tree-nesting ant, Azteca sericeasur, in response to a drastic reduction in the number of potential nesting sites. This surprising result is comprehensible when viewed in the context of the self-organized spatial dynamics of the ants and their effect on the ants' dispersal-limited natural enemies. Approximately 30% of the trees in the study site, a coffee agroecosystem in southern Mexico, were pruned or felled over a two-year period, and yet the abundance of the ant nests more than doubled over the seven-year study. Throughout the transition, the spatial distribution of the ants maintained a power-law distribution - a signal of spatial self organization - but the local clustering of the nests was reduced post-pruning. A cellular automata model incorporating the changed spatial structure of the ants and the resulting partial escape from antagonists reproduced the observed increase in abundance, highlighting how self-organized spatial dynamics can profoundly influence the responses of ecosystems to perturbations.