Supernova explosions are one of the most energetic--and potentially lethal--phenomena in the Universe. Scientists have speculated for decades about the possible consequences for life on Earth of a nearby supernova, but plausible candidates for such an event were lacking. Here we show that the Scorpius-Centaurus OB association, a group of young stars currently located at~130 parsecs from the Sun, has generated 20 SN explosions during the last 11 Myr, some of them probably as close as 40 pc to our planet. We find that the deposition on Earth of 60Fe atoms produced by these explosions can explain the recent measurements of an excess of this isotope in deep ocean crust samples. We propose that ~2 Myr ago, one of the SNe exploded close enough to Earth to seriously damage the ozone layer, provoking or contributing to the Pliocene-Pleistocene boundary marine extinction.