Massive stars end their short lives in spectacular explosions, supernovae, that synthesize new elements and drive galaxy evolution. Throughout history supernovae were discovered chiefly through their delayed optical light, preventing observations in the first moments (hours to days) following the explosion. As a result, the progenitors of some supernovae and the events leading up to their violent demise remain intensely debated. Here we report the serendipitous discovery of a supernova at the time of explosion, marked by an extremely luminous X-ray outburst. We attribute the outburst to the break-out of the supernova shock-wave from the progenitor, and show that the inferred rate of such events agrees with that of all core-collapse supernovae. We forecast that future wide-field X-ray surveys will catch hundreds of supernovae each year in the act of explosion, and thereby enable crucial neutrino and gravitational wave detections that may ultimately unravel the explosion mechanism.