The pipeline runs along a motorway on the outskirts of the capital and a spark caused by passing cars ignited crude that was leaking from the pipe, the petroleum ministry said.
The pipeline’s valves were immediately closed in the area of the blaze and the flames were brought under control, it added in a statement.
A witness at the scene said about two dozen cars were torched, apparently abandoned by motorists. A video posted online showed two residents pulling an injured person away from the highway while thick plumes of smoke billowed skyward.
There was no immediate word from authorities on why the pipeline had leaked. The state prosecutor dispatched a team to investigate, a statement said.
The crude pipeline runs from the Red Sea oil port of Shuqair to the refinery complex of Mostorod in Greater Cairo.
By Mahmoud Mourad, Ehab Farouk and Nayera Abdallah