In this study, the synthesis of a long-chain aliphatic amino compound and its sour corrosion inhibition properties were reported. Oleylamine was obtained through the reaction of 4-(Aminomethyl) pyridine with 1-chloro-octadecane. The identification and characterization of reaction products were carried out through Fourier transform infrared spectroscopy (FTIR) and gas chromatography/mass spectroscopy (GC-MS). Oleylamine was tested as a sour corrosion inhibitor for steels. Different concentrations of oleylamine (0, 5, 10, 25, and 100 ppm) in a sour saline electrolyte were analyzed. The dynamic anticorrosive behavior of oleylamine on carbon mild steel (AISI 1018) surfaces was evaluated using a laminar flow of 100 rpm and tested with potentiodynamic polarization (PDP) and electrochemical impedance spectroscopy (EIS) measurements. After electrochemical testing, the surface of the steel specimens that were used was characterized with Fourier transform infrared spectroscopy (FTIR) and scanning electron microscopy (SEM). The electrochemical results of the anticorrosive efficiency of oleylamine for steel showed an exponential behavior as a function of inhibitor concentration. At a concentration of 20 ppm of the inhibitor, the anticorrosive efficiency did not show any significant changes. However, at 100 ppm of the inhibitor, an efficiency of over 95% was achieved. After the electrochemical tests, the surface of the steel samples with the inhibitor revealed the formation of an inhibitor layer that prevented the corrosion of the steel.