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
Dozens of women gathered on Westminster Bridge to form a human chain in a show of solidarity with the victims of Wednesday's terror attack.
Cold with some misty cloud by dawn
Mum's across the nation have shared their delight at having actor Tom Hardy read another bedtime story on children's TV channel CBeebies.