GW170817 was the first gravitational-wave detection of a binary neutron-star merger. It was accompanied by radiation across the electromagnetic spectrum and localized to the galaxy NGC 4993 at a distance of 40 megaparsecs. It has been proposed that the observed γ-ray, X-ray and radio emission is due to an ultra-relativistic jet being launched during the merger (and successfully breaking out of the surrounding material), directed away from our line of sight (off-axis). The presence of such a jet is predicted from models that posit neutron-star mergers as the drivers of short hard-γ-ray bursts. Here we report that the radio light curve of GW170817 has no direct signature of the afterglow of an off-axis jet. Although we cannot completely rule out the existence of a jet directed away from the line of sight, the observed γ-ray emission could not have originated from such a jet. Instead, the radio data require the existence of a mildly relativistic wide-angle outflow moving towards us. This outflow could be the high-velocity tail of the neutron-rich material that was ejected dynamically during the merger, or a cocoon of material that breaks out when a jet launched during the merger transfers its energy to the dynamical ejecta. Because the cocoon model explains the radio light curve of GW170817, as well as the γ-ray and X-ray emission (and possibly also the ultraviolet and optical emission), it is the model that is most consistent with the observational data. Cocoons may be a ubiquitous phenomenon produced in neutron-star mergers, giving rise to a hitherto unidentified population of radio, ultraviolet, X-ray and γ-ray transients in the local Universe.