Ship detection with synthetic aperture radar (SAR) imagery often confronts severe speckle, heterogeneous regions, and system noise which cause false alarms due to the faint ship-sea contrast. Additionally, false negatives also occur when small vessels with low radar backscatter are observed. To solve these problems, a new ship detection method based on target enhancement and nonparametric clutter estimation is proposed. The method not only improves the ship-sea contrast for homogeneous and nonhomogeneous images but also adaptively estimates the clutter distribution in the enhanced image, which is crucial for the constant false-alarm rate (CFAR) detector. Subsequently, ships in the SAR image are detected by the proposed two-stage kernel density estimation CFAR (KDE-CFAR) with a low false-alarm rate and high detection probability. Compared with most existing algorithms, the proposed method provides a robust detection capability for both homogeneous and nonhomogeneous SAR images. Experimental results also reveal that the proposed method is an effective method for ship detection in various Radarsat-1 and Envisat ASAR images acquired with different operation modes.