We demonstrate experimentally the compression of femtosecond-scale pulses by two-photon gain in a compact electrically driven AlGaAs waveguide. Dynamic control of the pulse width from 240 to 140 fs is achieved by varying the current injection levels--in good agreement with the calculations. The pulse width is measured by a high-sensitivity intensity autocorrelator based on two-photon absorption in a GaAs photomultiplier tube.