Spaceborne synthetic aperture radar (SAR) can be easily interfered with by narrowband radio frequency interference (RFI) from ground radiation sources, causing significant degradation of image quality. In the application of SAR ship detection, the radio interference will raise the detection threshold of a constant false alarm rate (CFAR) detector, and consequently results in the degradation of detection performance. In order to solve this problem, we propose a ship-detection method for SAR under a narrowband RFI environment. The proposed method is mainly divided into five steps: (1) transform the input SAR image with narrowband RFI into 2-D frequency domain by fast Fourier transform (FFT); (2) use CFAR detector to detect RFI in 2-D frequency domain; (3) suppress RFI data points using adaptively weighting in the 2-D frequency domain; (4) transform the RFI suppressed 2-D spectrum into the image domain via inverse FFT; (5) apply CFAR detector for ship detection. Simulation and real data experiments show that the proposed method can effectively detect ships from SAR images with ocean background even if there exists serious RFI.