We demonstrate the operation of a novel all-optical flip-flop. The flip-flop consists of a slave 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 set and reset pulses were generated by external modulators at 1 Gbit/s. 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. (c) 2006 Optical Society of America.