A stochastic background of gravitational waves is expected to arise from a superposition of a large number of unresolved gravitational-wave sources of astrophysical and cosmological origin. It should carry unique signatures from the earliest epochs in the evolution of the Universe, inaccessible to standard astrophysical observations1. Direct measurements of the amplitude of this background are therefore of fundamental importance for understanding the evolution of the Universe when it was younger than one minute. Here we report limits on the amplitude of the stochastic gravitational-wave background using the data from a two-year science run of the Laser Interferometer Gravitational-wave Observatory2 (LIGO). Our result constrains the energy density of the stochastic gravitational-wave background normalized by the critical energy density of the Universe, in the frequency band around 100 Hz, to be <6.9 × 10^-6 at 95% confidence. The data rule out models of early Universe evolution with relatively large equation-of-state parameter3, as well as cosmic (super)string models with relatively small string tension4 that are favoured in some string theory models5. This search for the stochastic background improves on the indirect limits from Big Bang nucleosynthesis1,6 and cosmic microwave background7 at 100 Hz.