The Sun is located in a low-density region of the interstellar medium partially filled with hot gas that is the likely result of several nearby supernova explosions within the last 10 Myr. Here we use astrometric data to show that part of the Scorpius-Centaurus OB association was located closer to the present position of the Sun 5-7 Myr ago than today. Evolutionary synthesis models indicate that the association must have experienced ~20 supernova explosions in the last 10-12 Myr, a prediction that is supported by the detection of four or five runaway stars escaping from it. The ~6 SNe produced by the Lower Centaurus Crux subgroup are likely responsible for the creation of the Local Bubble.