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
US Justice Department plans to seek execution for Dylann Roof, who massacred nine black parishioners in a South Carolina church.
People trying e-cigarettes has doubled in number over two years, new research suggests.
Thirteen weeks since the power station collapsed and no-one can give the families a clear answer as to when their loved ones will be found.