Pakistani jets killed 16 suspected militants in bombing raids near the Afghan border on Saturday, and police arrested dozens of people, security officials said, the day after Taliban militants killed 29 people in an attack on an air base.
The attack on the base on Friday was the deadliest ever militant attack on a Pakistani military installation and is likely to undermine already rocky ties with Afghanistan.
Hours after the attack, Pakistan's military spokesman pointedly noted that communications intercepts showed the Pakistani Taliban gunmen were being directed by handlers in Afghanistan.
Saturday's air force raids targeted militant bases in the Tirah Valley, which straddles the Afghan border and is a main smuggling route between the two countries, two Pakistani security officials said.
"All those killed in the bombing were Pakistani militants," said one security official in the northwestern city of Peshawar.
On Friday, 13 gunmen stormed the Badaber air base, about 10 km (6 miles) south of Peshawar in an attack a Pakistani Taliban spokesman said was retaliation for bombing raids on their bases along the Afghan border.
Police said they picked up around 50 residents living near the base on suspicion of helping the militants organise the attack.
Shafqat Malik, head of the Peshawar bomb squad, said the attackers carried enough firepower to occupy the base, but that some of their weapons had malfunctioned. Each man had an assault rifle, two improvised explosive devices, and several rocket propelled grenades, but some of the grenades misfired, he said.
"Their mission was occupation of the air base," he said.
For decades Pakistan nurtured Islamist militants as allies against old rival India, and to fight Soviet forces in Afghanistan in the 1980s.
But it has been fighting some militant factions since after it sided with the United States following the Sept. 11, 2001, al Qaeda attacks on U.S. cities.
Pakistan launched an offensive to dislodge Pakistani Taliban from their northwestern stronghold of North Waziristan in 2014 and there has been fighting in various places, including the Tirah Valley, since then.
For years Pakistan and Afghanistan have traded accusations of not doing enough to stamp out insurgents on either side of their long, porous border.
Each country has a separate but allied Taliban insurgency fighting to overthrow the government and install strict Islamist rule and security cooperation is seen as vital to defeat militancy.
Last month, Afghanistan blamed Pakistan for not doing enough to counter militants who carried out a series of attacks in the Afghan capital, Kabul.