QUETTA, Pakistan — Gunmen in southwestern Pakistan on Thursday killed a police surgeon who had received threats for his role in investigating the deaths of five foreigners at the hands of security forces earlier this year, police said.

Surgeon Baqir Shah conducted the autopsies on the five foreigners, including three women, who security forces initially said were would-be suicide bombers who died May 17 when they detonated a grenade at a checkpoint near Quetta, the capital of Baluchistan province.

But Shah found that the unarmed foreigners from central Asia, one of whom was pregnant, were killed by a hail of bullets. Video showed one of the women raising her arm in what appeared to be a pleading gesture as the security forces fired.

Shah was severely beaten by men who he claimed were police soon after he testified before a government commission set up to investigate the deaths. Police denied the allegations.

The surgeon continued to receive threats until he was shot Thursday by unknown gunmen in Quetta, said police officer Nazir Ahmed Khurd.

The government tribunal held several police and paramilitary soldiers responsible for the deaths of the foreigners.