Imidazoline obtained from the essential oil contained in Pouteria sapota seed was tested as an environmentally-friendly corrosion inhibitor of 1018 carbon steel in CO2 saturated 3.5 % NaCl solution using electrochemical techniques. This imidazoline contains fatty acids with the presence of long hydrophobic chains, with 52.73 % of unsaturated (oleic and linolenic acids) and 40 % of saturated (palmitic and myristic acids) compounds. Polarization curves revealed that this inhibitor is highly efficient mixed-type of inhibitor with the inhibitor efficiency of 99.9 % reached at 25 ppm. Also, the lowest pitting potential value was observed at 25 ppm of inhibitor, making the carbon steel highly susceptible to the pitting type of corrosion. Corrosion current density value decreased by nearly four orders of magnitude, and a passive film formation was induced for inhibitor concentrations higher than 5 ppm. Accordingly, polarization resistance values were increased from 100 W cm2 up to about 106 W cm2 at 25 ppm of inhibitor. The inhibitor forms a protective film of corrosion products adsorbed on the metal surface in a very strong chemical way, following a Langmuir type of adsorption isotherm. This was supported by electrochemical impedance spectra that showed two relaxation processes ascribed to electrode interface and film regions. In agreement with polarization resistance data, the total electrode resistance determined by interfacial charge transfer and film resistance, increased up to 8.2 ´ 105 W cm2 in presence of 25 ppm of inhibitor. SEM images additionally showed that type of corrosion was fully changed from uniform to a localized type when 25 ppm of inhibitor was added into the solution.