  The temporal resolution of ultrafast electron diffraction (UED) at weakly
relativistic beam energies ($\lesssim$ 100 keV) suffers from space-charge
induced electron pulse broadening. We describe the implementation of a radio
frequency (RF) cavity operating in the continuous wave regime to compress high
repetition rate electron bunches from a 40.4 kV DC photoinjector for ultrafast
electron diffraction applications. Active stabilization of the RF amplitude and
phase through a feedback loop based on the demodulated in-phase and quadrature
components of the RF signal is demonstrated. This scheme yields 144$\pm$19 fs
RMS temporal resolution in pump-probe studies.
