The Pakistani military and Islamist militants have been fighting each other in the region for more than two decades.
Mr Ahmed said that a police officer and a civilian were among the dead.
An officer said that the possibility of terrorism was being looked into.
Protests led by rights groups whose leaders accuse the Pakistani military of being soft on the Islamist militants are common in the volatile north-west of Pakistan.
The teacher had shown his pupils caricatures of the Prophet Mohammad in a class on freedom of expression, angering some Muslim parents.
Pakistani troops have killed eight Islamist militants in a shoot-out in the volatile north-western border region, says the military.
He also warned that ongoing military operations would have “military and humanitarian repercussions” that could spiral out of control.
It is also because of its uranium and oil reserves that it has economic and strategic importance for the United States, Europe, China, and Russia.
He said the militants kidnapped several others, who are now missing.
Tensions between Europe and Mali are nearing boiling point, with France suspending the country’s air travel.
