The pipeline was damaged by construction work at about 6:30 pm today, allowing oil to flow into a sewage pipe, where it caught fire, China National Petroleum Corp. Said in a statement. It said the oil burned for 25 minutes before being extinguished.
No deaths or injuries were reported. CNPC said 20,000 nearby residents were evacuated.
Five people from the construction company blamed for damaging the pipeline were detained by police while an investigation was underway, the official Xinhua News Agency said.
Such incidents have fuelled opposition to allowing oil-handling facilities in densely populated cities.
Members of the public have grown more alarmed about the proximity of oil lines to municipal utility lines, residential neighbourhoods and commercial districts.