Supernovae connected with long-duration gamma-ray bursts (GRBs) are hyper-energetic explosion resulting from the collapse of very massive stars (about 40Mo, where Mo is the mass of the Sun) stripped of their outher 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, which demonstrate that the supernova had a much smaller explosion energy and ejected much less mass than the other GRB-sueprnovae, suggesting that it was produced by a star whose initial mass was only about 20Mo. 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 for the more massive stars collapsing to a black hole, and magnetic activity of the nascent neutron star for the less massive stars.