Knowledge of the properties of γ-ray bursts has increased substantially following recent detections of counterparts at X-ray, optical and radio wavelengths. But the nature of the underlying physical mechanism that powers these sources remains unclear. In this context, an important question is the total energy in the burst, for which an accurate estimate of the distance is required. Possible host galaxies have been identified for the first two optical counterparts discovered, and a lower limit obtained for the redshift of one of them, indicating that the bursts lie at cosmological distances. A host galaxy of the third optically detected burst has now been identified and its redshift determined to be z = 3.42. When combined with the measured flux of γ-rays from the burst, this large redshift implies an energy of 3× 10$^53$erg in the γ-rays alone, if the emission is isotropic. This is much larger than the energies hitherto considered, and it poses a challenge for theoretical models of the bursts.