A simple scheme for an all-optical AND logic gate is proposed based on a sagnac interferometric structure. The operations of this scheme with a 40-Gbit/s return-to-zero (RZ) pseudorandom bit stream (PRBS) are simulated correctly with an output extinction ratio (ER) of about 14.7 dB. Through numerical analyses and discussions, it can be seen that the output ER of the AND operation is improved more than 6 dB, and the output pattern effect is decreased by about 0.4, compared to terahertz optical asymmetric demultiplexer schemes under the same condition. Furthermore, the carrier recovery time of a semiconductor optical amplifier (SOA) is no longer a crucial parameter to restrict the operation speed of this scheme. This scheme is potentially capable of AND operation rates to 100 Gbit/s.