Failures of underground oil pipes caused by pitting perforation are investigated in this paper. The chemical composition of the failed oil pipe was analyzed by the direct reading spectrometer, which is in accordance with China national standard GB/T699‐1999 for 20 steel. The failed parts were investigated by means of visual observation, optical microscope (OM) and scanning electron microscope (SEM). Energy‐dispersive X‐ray spectroscopy (EDS) of the inner pits were conducted. The results indicate that the pit on the failed oil pipe is composed of three smaller circular pits, on which a fatigue striation‐like pattern suggests a repetitionary pitting corrosion process, while pitting corrosion in the vertical direction is more serious. The failed position was located in the underground ditch where carbon dioxide (CO2) deposited and underwent wetting and drying cycles with an alternative of rainy and sunny days. Combined with the environment of the oil pipe, the simulation experiment, and corresponding mechanism analysis was conducted to evolve the mechanism of pitting corrosion, initiated by the synergistic effect of CO2 and chloride ions (Cl−), and impelled the production of FeCO3 corrosion agents providing an isolated space in a short time, meanwhile chloride ions proceed to propagate continuously into the inner pit, which could explain pitting corrosion is more serious in the vertical direction.