  Binary neutron-star mergers (BNSMs) are among the most readily detectable
gravitational-wave (GW) sources with LIGO. They are also thought to produce
short $\gamma$-ray bursts (SGRBs), and kilonovae that are powered by r-process
nuclei. Detecting these phenomena simultaneously would provide an unprecedented
view of the physics during and after the merger of two compact objects. Such a
Rosetta Stone event was detected by LIGO/Virgo on 17 August 2017 at a distance
of $\sim 44$ Mpc. We monitored the position of the BNSM with ALMA at 338.5 GHz
and GMRT at 1.4 GHz, from 1.4 to 44 days after the merger. Our observations
rule out any afterglow more luminous than $3\times 10^{26}~{\rm
erg\,s}^{-1}\,{\rm Hz}^{-1}$ in these bands, probing $>$2--4 dex fainter than
previous SGRB limits. We match these limits, in conjunction with public data
announcing the appearance of X-ray and radio emission in the weeks after the GW
event, to templates of off-axis afterglows. Our broadband modeling suggests
that GW170817 was accompanied by a SGRB and that the GRB jet, powered by
$E_{\rm AG,\,iso}\sim10^{50}$~erg, had a half-opening angle of $\sim20^\circ$,
and was misaligned by $\sim41^\circ$ from our line of sight. The data are also
consistent with a more collimated jet: $E_{\rm AG,\,iso}\sim10^{51}$~erg,
$\theta_{1/2,\,\rm jet}\sim5^\circ$, $\theta_{\rm obs}\sim17^\circ$. This is
the most conclusive detection of an off-axis GRB afterglow and the first
associated with a BNSM-GW event to date. Assuming a uniform top-hat jet, we use
the viewing angle estimates to infer the initial bulk Lorentz factor and true
energy release of the burst.
