We propose a new algorithm for ship detection in synthetic aperture radar (SAR) images based on the human visual attention system. The human visual attention system identifies the prominent objects in images or scenes so that these objects can be more noticeable. Since the ships in a SAR image of the ocean are prominent objects, they can easily be identified through the human visual attention system. Thus, for detection of ships in the SAR images, the present study (through its application) has modeled the human visual attention system in the detection stage. In this way, not only can the targets be precisely detected, but also the falsely detected pixels are significantly reduced. Compared to most existing algorithms in the literature, our proposed algorithm can be used for both homogeneous and nonhomogeneous images. Accordingly, its performance is independent of the image type (homogeneous or nonhomogeneous) and the computation time significantly decreases. Experimental results have shown the efficiency of the proposed algorithm for various SAR images from ERS-1, ERS-2, and ALOS PALSAR data.