We propose and experimentally demonstrate a new approach to dramatically reduce the spectral broadening induced by self-phase modulation occurring in a Kerr medium. By using a temporal sinusoidal phase modulation, we efficiently cancel to a large extent the chirp induced by the nonlinear effect. Experimental validation carried out in a passive or amplifying fiber confirms the interest of the technique for the mitigation of the spectral expansion of long pulses.