We demonstrate a new technique for femtosecond-pulse generation that employs ultrafast modulation of a laser field phase by impulsively excited molecular rotational or vibrational motion with subsequent temporal compression. An ultrashort pump pulse at 800 nm performs impulsive excitation of a molecular gas in a hollow waveguide, and a weak delayed probe pulse at 400 nm is scattered on the temporal oscillations of its dielectric index. The resultant sinusoidal phase modulation of the probe pulse permits probe pulse temporal compression by use of both positively and negatively dispersive elements. The potential of this new method is demonstrated by the generation of a periodic train of 5.8-fs pulses at 400 nm with positive group-delay dispersion compensation.