The northward-flowing Humboldt Current hosts perpetually high levels of productivity along the western coast of South America. Here, we aim to elucidate the deep-time history of this globally important ecosystem based on a detailed palaeoecological analysis of the exceptionally preserved middle–upper Miocene vertebrate assemblages of the Pisco Formation of the East Pisco Basin, southern Peru. We summarise observations on hundreds of fossil whales, dolphins, seals, seabirds, turtles, crocodiles, sharks, rays, and bony fishes to reconstruct ecological relationships in the wake of the Middle Miocene Climatic Optimum, and the marked cooling that followed it. The lowermost, middle Miocene Pisco sequence (P0) and its vertebrate assemblage testify to a warm, semi-enclosed, near-shore palaeoenvironment. During the first part of the Tortonian (P1), high productivity within a prominent upwelling system supported a diverse assemblage of mesopredators, at least some of which permanently resided in the Pisco embayment and used it as a nursery or breeding/calving area. Younger portions of the Pisco Formation (P2) reveal a more open setting, with wide-ranging species like rorquals increasingly dominating the vertebrate assemblage, but also local differences reflecting distance from the coast. Like today, these ancient precursors of the modern Humboldt Current Ecosystem were based on sardines, but notably differed from their present-day equivalent in being dominated by extremely large-bodied apex predators like Livyatan melvillei and Carcharocles megalodon.