Evolutionary dynamics can occur over similar time scales as ecological selection, meaning that there can be feedback between ecology and evolution. However, evidence of concordant eco-evolutionary selection often comes from in vitro studies, where there necessarily will be strong selection. Moreover, these studies have typically focussed on different focal traits meaning ecological and evolutionary dynamics are not directly comparable. Here, we quantify ecological and evolutionary responses to selection of the same trait measured both within and between species. We focus on siderophore production – these costly secretions are not only used to scavenge poorly soluble iron but also to detoxify environments polluted with other metals. In the context of detoxification, siderophores can benefit both the producer and nearby cells by preventing toxic metal uptake into the bacterial cell. We found that responses to copper-imposed selection within and between species were ultimately the same – intermediate levels were favoured – and occurred over similar time scales. Despite being a social trait, this represents the optimal strategy regardless of the social context. Our study unequivocally demonstrates that evolutionary selection can drive changes as rapidly as ecological selection.