Gamma-ray bursts (GRBSs) are produced by rare types of massive stellar explosions. Their rapidly fading afterglows are often bright enough at optical wavelengths, that they are detectable up to cosmological distances. Hirtheto, the highest known redshift for a GRB was z=6.7, for GRB 080913, and for a galaxy was z=6.96. Here we report observations of GRB 090423 and the near-infrared spectroscopic measurement of its redshift z=8.1^{+0.1}_{-0.3}. This burst happened when the Universe was only ~4% of its current age. Its properties are similar to those of GRBs observed at low/intermediate redshifts, suggesting that the mechanisms and progenitors that gave rise to this burst about 600 million years after the Big Bang are not markedly different from those producing GRBs ~10 billion years later.