This paper presents a novel algorithm based on the attenuation horizontal component for wind direction retrieval from X-band marine radar images. The range dependence of radar return on the ocean surface can be presented in radar images, and the radar return decreases with the increase in range. The traditional curve-fitting method averages the radar return of the whole range to retrieve the wind direction, but it is vulnerable to the interference of fixed objects and long-range low-intensity pixel points. For the pixels with the same range in the polar coordinates of the radar image, the ideal range attenuation model is derived by selecting the pixels with the highest intensity value. The ideal attenuation model is used to fit the attenuation data and calculate the attenuation horizontal component at each azimuth direction. To eliminate the effect of outliers, the iterative optimization method is used in the estimation of the attenuation horizontal component and the weights of the data are continuously updated. Finally, the wind direction is determined based on the azimuthal dependence of the attenuation horizontal component. This algorithm was tested using shipboard radar images and anemometer data collected in the East China Sea. The results show that, compared with the single curve-fitting method, the proposed algorithm can improve the wind direction retrieval accuracy in the case of more fixed targets. Under the condition of more fixed targets, the deviation and root mean square error are reduced by 16.3° and 16.2°, respectively.