File Photo: Pakistan Army soldiers patrol in a vehicle. AFP
The gun battle was the latest episode of violence in Pakistan involving extremist groups that appear to have been emboldened by the return to power of the Taliban in Afghanistan.
The dawn raid was carried out in Peshawar, capital of the northwestern Khyber Pakhtunkhwa province, said Javed Khan, an officer with the provincial Counter-Terrorism Department. The branch is a special police unit that fights local and foreign militant groups.
Khan said the slain militants were Afghans, and that the raid foiled a possible terrorist attack. Two other fighters managed to flee, he said, giving no further details.
Pakistan has witnessed scores of terrorist attacks in recent years, most of which were claimed by the Pakistani Taliban and the Islamic State group. Both organizations have been emboldened by Taliban resurgence in Afghanistan, where Pakistani militants are still believed to be hiding.
Pakistan's foreign minister Shah Mahmood Qureshi was in Kabul along with a delegation on Thursday for talks on a range of issues, the foreign ministry said before news of the raid was released. It was unclear whether the matter would come up in discussion.