Long-lived emission, known as afterglow, has now been detected from about a dozen γ-ray bursts. Distance determinations place the bursts at cosmological distances, with redshifts, z, ranging from åisebox-0.5ex 1 to 3. The energy required to produce these bright γ-ray flashes is enormous: up to i̊sebox-0.5ex 10$^ 53$erg, or 10 per cent of the rest-mass energy of a neutron star, if the emission is isotropic. Here we present optical and near-infrared observations of the afterglow of GRB990123, and we determine a redshift of z >= 1.6. This is to date the brightest γ-ray burst with a well-localized position and if the γ-rays were emitted isotropically, the energy release exceeds the rest-mass energy of a neutron star, so challenging current theoretical models of the sources. We argue, however, that our data may provide evidence of beamed (rather than isotropic) radiation, thereby reducing the total energy released to a level where stellar- death models are still tenable.