There are many cases where animal populations are affected by predators and resources in terrestrial ecosystems, but the factors that determine when one or the other predominates remain poorly understood. Here we show, using 40 years of data from the highly diverse mammal community of the Serengeti ecosystem, East Africa, that the primary cause of mortality for adults of a particular species is determined by two factors--the species diversity of both the predators and prey and the body size of that prey species relative to other prey and predators. Small ungulates in Serengeti are exposed to more predators, owing to opportunistic predation, than are larger ungulates; they also suffer greater predation rates, and experience strong predation pressure. A threshold occurs at prey body sizes of approximately 150 kg, above which ungulate species have few natural predators and exhibit food limitation. Thus, biodiversity allows both predation (top-down) and resource limitation (bottom-up) to act simultaneously to affect herbivore populations. This result may apply generally in systems where there is a diversity of predators and prey.