  We report on time-resolved linear and nonlinear terahertz spectroscopy of the
two-band superconductor MgB$_2$ with the superconducting transition temperature
$T_c \approx 36$ K. Third-harmonic generation (THG) is observed below $T_c$ by
driving the system with intense narrowband THz pulses. For the pump-pulse
frequencies $f=$ 0.3, 0.4, and 0.5 THz, temperature-dependent evolution of the
THG signals exhibits a resonance maximum at the temperatures with the resonance
conditions $2f=2\Delta_\pi(T)$ fulfilled, for the dirty-limit superconducting
gap $2\Delta_\pi$. In contrast, for $f=$ 0.6 and 0.7 THz with
$2f>2\Delta_\pi(T\rightarrow0)=1.03$ THz, the THG intensity increases
monotonically with decreasing temperature. Moreover, for
$2f<2\Delta_\pi(T\rightarrow0)$ the THG is found nearly isotropic with respect
to the pump-pulse polarization. These results suggest a predominant
contribution of the driven Higgs amplitude mode of the dirty-limit $\pi$-band
superconducting gap, pointing to the importance of scattering for observation
of the Higgs mode in superconductors.
