The blast targeted the convoy of Prosecutor General Hisham Barakat and destroyed several cars in the eastern neighborhood of Heliopolis. Six other people were reported injured.
Initial media reports had called Barakat's injuries grave, but Health Ministry spokesman Hossam Abdel-Ghaffar had insisted on state TV that none of the injuries was life-threatening.
Police said they had no details yet on the cause of the explosion.
Barakat's death came a day before the second anniversary of the mass protests against former Egyptian President Mohamed Morsy
The military removed Morsy from office in July 2013. Since then, security services in the country have imposed a deadly cracked down on members of Morsy's Muslim Brotherhood, which the Egyptian government calls a terrorist organization.
Several groups have claimed responsibility for attacks that have killed hundreds of police and soldiers over the past two years.
The Sinai-based, ISIS-affiliated State of Sinai -- formerly known as Ansar Bait El-Maqdis -- has claimed responsibility for the deadliest of these attacks.
'His life is always threatened'
The Muslim Brotherhood has denied government allegations that it has been responsible for the violence. But in May, the group endorsed a call by clerics to fight the July 2013 coup that overthrew Morsy by all means possible, including retribution against army officers, police officers, judges, journalists and politicians whom the Muslim Brotherhood accuses of being complicit in the killing of innocent civilians.
Over the past several months, militants have targeted judges. In May, three judges were shot dead in North Sinai.
's judges have been targeted since the trials of terrorist groups and their members began," Abdalla Fathy, the head of Egypt's judges' club, told CNN in May. "But there are specific people that confronted the Muslim Brotherhood regime, and these were the ones initially targeted."
The prosecutor general's office is responsible for referring all criminal cases, including controversial terrorism and political cases, to court.
"His life is always threatened," the prosecutor general's office told CNN when asked about threats just before his death was announced.