Abstract: (IOP)The production of a primordial stochastic gravitational-wave (GW) background by processes occuring in the early Universe is expected in a broad range of models. Observing this background would open a unique window onto the Universeʼs evolutionary history. Probes like the cosmic microwave background (CMB) or the baryon acoustic oscillations (BAO) can be used to set upper limits on the stochastic GW background energy density for frequencies above 10(−)(15) Hz. We perform a profile likelihood analysis of the Planck CMB temperature anisotropies and gravitational lensing data combined with WMAP low-ℓ polarization, BAO, South Pole Telescope and Atacama Cosmology Telescope data. We find that at a 95% confidence level for adiabatic initial conditions, which improves over the previous limit by a factor 2.3. Assuming that the primordial GW has been produced by a network of cosmic strings, we have derived exclusion limits in the cosmic string parameter space. If the size of the loops is determined by gravitational back-reaction, string tension values greater than ∼4 × are excluded for a reconnection probability of 10(−)(3).