  We compute the hadronic light-by-light scattering contribution to the muon
$g-2$ from the charm quark using lattice QCD. The calculation is performed on
ensembles generated with dynamical $(u,d,s)$ quarks at the SU(3)$_{\rm f}$
symmetric point with degenerate pion and kaon masses of around 415 MeV. It
includes the connected charm contribution, as well as the leading disconnected
Wick contraction, involving the correlation between a charm and a light-quark
loop. Cutoff effects turn out to be sizeable, which leads us to use
lighter-than-physical charm masses, to employ a broad range of lattice spacings
reaching down to 0.039 fm and to perform a combined charm-mass and continuum
extrapolation. We use the $\eta_c$ meson to define the physical charm-mass
point and obtain a final value of $a_\mu^{\rm HLbL,c} = (2.8\pm 0.5) \times
10^{-11}$, whose uncertainty is dominated by the systematics of the
extrapolation. Our result is consistent with the estimate based on a simple
charm-quark loop, whilst being free of any perturbative scheme dependence on
the charm mass. The mixed charm-light disconnected contraction contributes a
small negative amount to the final value.
