Five Pakistani soldiers were killed in gunbattles with Islamist militants in Khyber district, northwest Pakistan, near the Afghan border on Monday.
Two other soldiers, including an officer, were killed the previous day in an operation against militants in Peshawar.
A total of 23 militants were killed in three intelligence-based operations over the last two days.
The militants were involved in terrorist activities against security forces and civilians, but their group was not identified.
The lawless tribal regions along the Afghan border have historically served as a safe haven for Islamist and sectarian militants under the umbrella group Tehreek-e-Taliban Pakistan (TTP).
The Tehreek-e-Taliban Pakistan (TTP) seeks to overthrow the Pakistani government and establish strict Islamic law.
Pakistan accuses TTP leaders of seeking refuge in neighboring
Afghanistan and running militant training camps there.
Tensions between the two countries have increased, with Pakistan criticizing
Afghanistan for not doing enough to combat militant groups attacking Pakistan.
On Sunday, Pakistan claimed to have arrested 11 Islamist militants involved in a suicide bombing that killed five Chinese engineers, alleging the attack was planned by the TTP in
Afghanistan.
Afghanistan has previously denied such allegations.
Relations between the two countries have deteriorated due to these issues.