This paper reports on progress in developing an effective method for internal pipeline corrosion control in the presence of CO2. The inhibition effect of talloil diethylenetriamine imidazoline (TOFA/DETA imidazoline) on corrosion of mild steel API X65 in CO2-saturated 3 wt. % NaCl solution was investigated by: linear polarization resistance (LPR), potentiodynamic sweep (PDS), electrical resistance (ER) measurements, and atomic force microscopy (AFM). Novel top-of-the-line corrosion (TLC) mitigation method was verified in an innovative glass cell set-up and in a large scale flow loop. It was demonstrated that TOFA/DETA imidazoline can successfully protect the mild steel surface from corrosion in CO2-saturated 3 wt. % NaCl with the inhibition efficiency up to 92%. The TLC rate of mild steel, as measured in the vapor phase using the ER probe, was reduced effectively by periodic treatment by the foam containing TOFA/DETA imidazoline corrosion inhibitor in both glass cell and the large scale flow loop. The corrosion inhibition efficiency was calculated to be higher than 90 % and the inhibition effect lasted up to 50 h.