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
John Wombell, 58, was jailed for eight weeks after admitting making the grossly offensive call to the Broxtowe MP's office last November.
A late April chill with a cold northerly wind
Where do the Conservatives, Liberal Democrats, and Labour stand on Brexit, immigration and the idea of a second referendum?