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
This evening it'll become largely dry across the UK as the showers in the west gradually die down.
Multiple fatalities have been reported after an attack on a centre for disabled people near Tokyo, Japanese media reports suggest.
In a blog, basketball great Michael Jordan spoke out about the recent killings of both unarmed black men and police in the US.