Soft γ-ray repeaters (SGRs) emit multiple, brief (~0.1-s), intense outbursts of low-energy γ-rays. They are extremely rare-three are known in our Galaxy and one in the Large Magellanic Cloud. Two SGRs are associated with young supernova remnants (SNRs), and therefore most probably with neutron stars, but it remains a puzzle why SGRs are so different from `normal' radio pulsars. Here we report the discovery of pulsations in the persistent X-ray flux of SGR1806 - 20, with a period of 7.47s and a spindown rate of 2.6 × 10-3syr-1. We argue that the spindown is due to magnetic dipole emission and find that the pulsar age and (dipolar) magnetic field strength are ~1,500 years and 8× 1014gauss, respectively. Our observations demonstrate the existence of `magnetars', neutron stars with magnetic fields about 100 times stronger than those of radio pulsars, and support earlier suggestions, that SGR bursts are caused by neutron-star `crustquakes' produced by magnetic stresses. The `magnetar' birth rate is about one per millennium-a substantial fraction of that of radio pulsars. Thus our results may explain why some SNRs have no radio pulsars.