Pakistani security forces on Tuesday killed at least 23 militants in the troubled north—western province of Khyber—Pakhtunkhwa, security officials said.

The violence occurred in the Maidan area of the Lower Dir district, where Pakistan’s forces launched a hunt for Islamist rebels responsible for twin suicide attacks on Monday against a military camp in the area.

Senior police officer Mumtaz Zareen said the clashes erupted when the militants hiding in the area fired on troops.

“The soldiers retaliated with heavy fire and killed at least 23 militants,” Mr. Zareen said.

The military launched an operation against Taliban militants in Lower Dir and the adjacent Swat district early last year and recaptured the district from Islamist insurgents after weeks of intense fighting.

The government has declared victory over the militants, but sporadic violence continues, and rebels hiding in the pine—clad mountains occasionally target the forces to register their presence and resilience.

In a similar attempt on Monday, they blew up two car bombs near an army camp in Lower Dir, killing a soldier and four suicide bombers.

Seven troops were injured.

Officials said the attack was a botched attempt by the Taliban to free some of their colleagues held at the camp.

More In: International | News