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
All weekend it felt as though the new administration had a self-destruct button and was desperately searching for it.
Areas of dense freezing fog could mean possible delays to air travel until 10.30am, according to forecasts.
Survey shows support for compulsory sex and relationship education classes as students struggle to deal with online sexual harassment.