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
Ed Miliband unveils a giant stone chiselled with Labour's pledges to be installed in the No.10 Rose Garden if he becomes prime minister.
Florence Welch has revealed fellow songstress Taylor Swift gave her some lessons in love after the star-studded Met Gala.
British aid workers in Nepal have told ITV News of the challenges they face trying to treat earthquake victims in a perilous hospital