The corrosion in petroleum pipelines was investigated by the studying the corrosion of carbon steel in crude oil and refined petroleum products which include gasoline, kerosene, and gas oil. Weight loss method was used in which test specimens of carbon steel, with a known weights, were immersed in the test media for a total exposure time of 60 days. The weight loss was measured at an interval of 10 days and the corrosion rate was determined. The results showed that corrosion rate are highest for gasoline followed by kerosene, gas oil and crude oil, in a decreasing order. The observed pattern in the corrosion behavior is consistent with the density and weight percent of hydrogen in the hydrocarbon products. The corrosion rate increases with decreasing density and increasing weight percent of hydrogen. Experiments were carried out at different temperatures (30, 60, 90 and 120oC) at a constant partial pressure of CO2 (50psi) in 3.5% NaCl solution. The results indicated that as partial pressure of CO2 and temperature increase, corrosion rate increases due to due to continuous dissolution of iron ion and formation of weak carbonic acid. The weak carbonic acid dissociates into carbonate and hydrogen ion, which increases the cathodic reaction on the metal surface.The presence of small amount of H2S (0.4 ppm) increases the corrosion rate significantly.