  We study a sector of the 5d maximally supersymmetric Yang-Mills theory on
$S^5$ consisting of $1/8$-BPS Wilson loop operators contained within a great
$S^3$ inside $S^5$. We conjecture that these observables are described by a 3d
Chern Simons theory on $S^3$, analytically continued to a pure imaginary
Chern-Simons level. Therefore, the expectation values of these 5d Wilson loops
compute knot invariants. We verify this conjecture in the weakly-coupled regime
from explicit Feynman diagram computations. At strong coupling, these Wilson
loop operators lift to $1/8$-BPS surface operators in the 6d $(2,0)$ theory on
$S^1\times S^5$. Using AdS/CFT, we show that these surface operators are dual
to M2-branes subject to certain calibration conditions required in order to
preserve supersymmetry. We compute the renormalized action of a large class of
calibrated M2-branes and obtain a perfect match with the field theory
prediction. Finally, we present a derivation of the 3d Chern-Simons theory from
5d super-Yang-Mills theory using supersymmetric localization, modulo a subtle
issue that we discuss.
