Supernovae connected with long-duration γ-ray bursts (GRBs) are hyper-energetic explosions resulting from the collapse of very massive stars (∼40M⊙, where M⊙ is the mass of the Sun) stripped of their outer hydrogen and helium envelopes. A very massive progenitor, collapsing to a black hole, was thought to be a requirement for the launch of a GRB. Here we report the results of modelling the spectra and light curve of SN 2006aj (ref. 9), which demonstrate that the supernova had a much smaller explosion energy and ejected much less mass than the other GRB-supernovae, suggesting that it was produced by a star whose initial mass was only ∼20M⊙. A star of this mass is expected to form a neutron star rather than a black hole when its core collapses. The smaller explosion energy of SN 2006aj is matched by the weakness and softness of GRB 060218 (an X-ray flash), and the weakness of the radio flux of the supernova. Our results indicate that the supernova-GRB connection extends to a much broader range of stellar masses than previously thought, possibly involving different physical mechanisms: a 'collapsar' (ref. 8) for the more massive stars collapsing to a black hole, and magnetic activity of the nascent neutron star for the less massive stars.