A novel all-optical flip-flop is proposed and demonstrated experimentally. The flip-flop consists of a conventional multi-mode Fabry-Perot laser diode (FP-LD) and a specially designed master FP-LD which has a built-in external cavity and operates in single longitudinal mode oscillation. The triggering pulses were generated by external modulators with non-return-to-zero pulse pattern generators. The rising and falling times of the output signal in on-off operation of the flip-flop were about 50 ps. The required powers of both set and reset pulses were less than -9 dBm.