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
Victoria Beckham's youngest son had his track "If Every Day Was Christmas" premiered on Capital FM on Wednesday morning.
Pfizer and Flynn Pharma broke competition law when they increased the cost of a medicine used by around 48,000 patients in the UK.
Some of those killed in the warehouse blaze sent final messages to loved ones saying "I'm going to die" and "I love you", it has emerged.