A cornerstone of Einsteinĝ€™s special relativity is Lorentz invarianceĝ€"the postulate that all observers measure exactly the same speed of light in vacuum, independent of photon-energy. While special relativity assumes that there is no fundamental length-scale associated with such invariance, there is a fundamental scale (the Planck scale, l(Planck)1.62×10-33cm or E(Planck) ≤ M(Planck)c 21.22×1019GeV), at which quantum effects are expected to strongly affect the nature of spaceĝ€"time. There is great interest in the (not yet validated) idea that Lorentz invariance might break near the Planck scale. A key test of such violation of Lorentz invariance is a possible variation of photon speed with energy. Even a tiny variation in photon speed, when accumulated over cosmological light-travel times, may be revealed by observing sharp features in-ray burst (GRB) light-curves. Here we report the detection of emission up to 31GeV from the distant and short GRB090510. We find no evidence for the violation of Lorentz invariance, and place a lower limit of 1.2E(Planck) on the scale of a linear energy dependence (or an inverse wavelength dependence), subject to reasonable assumptions about the emission (equivalently we have an upper limit of l(Planck)/1.2 on the length scale of the effect). Our results disfavour quantum-gravity theories in which the quantum nature of spaceĝ€"time on a very small scale linearly alters the speed of light.