This paper describes an algorithm for the detection of low- and high-contrast targets in forward-looking infrared imagery while rejecting the effects of clutter and other associated detrimental factors. The proposed automatic target recognition algorithm involves two modules—a detector module and a clutter rejection module. The detection algorithm, based on morphology-based preprocessing, acts as a prescreener that selects possible candidate target regions for further analysis and places target-size markers in those preselected regions. The application of simple nonlinear grayscale operations in the proposed detection algorithm has been found to be especially suitable for real-time implementation. The clutter rejection module uses target- and background-specific information, extracted from training sample, to reduce false alarms often generated in the detection step. The application of two Mahalonobis distances, derived from target and background features of the training image, improves false-alarm rejection. Preliminary results indicate that the developed detection and clutter rejection modules exhibit excellent detection performance for both low- and high-contrast targets in complex backgrounds while ensuring a low false-alarm rate.