Chaudhry Zulfikar was shot at least 13 times as he drove to court in the capital Islamabad.
He then lost control of his car, which hit a woman passer-by and killed her, police said.
Mr Zulfikar was also prosecuting militants linked to the 2008 terror attack in the Indian city of Mumbai.
Although the motive for the killing was unclear, the prosecutor's involvement in the two high-profile cases is likely to be scrutinised closely.
More top news
The smuggler turned hero - made famous by Harrison Ford - will star in his own stand-alone film, Disney says.
Presented to the American press as an LA Galaxy player, former England captain says David Beckham influenced his move Stateside.
Vulnerable young people should be allowed to stay in care until the age of 25, the children's commissioner for England has said.