A sub-mm wave source based on Cherenkov resonant radiation of a microbunched electron beam radiating coherently in a dielectric-loaded pipe. The microbunched electron beam is produced in a pulse photoinjector by illuminating a metal photocathode with sub-ps or multi-ps intensity-modulated laser beam with a beat wave or multiplexing at terahertz frequencies, the photoelectrons generated at the photocathode being accelerated by an electric field and sub-wavelength focused by magnetic field to propagate through a resonant radiator comprising a corrugated wall or smooth-wall metal capillary pipe internally coated with dielectric and attached to an antenna.