Islamic militants attacked a Pakistani fort near the Afghan border early Tuesday, killing five soldiers and wounding seven others, the military said.
The troops retaliated during the attack on Ladha Fort in South Wazirstan, "causing heavy casualties" for the attackers, a military statement said.
The area around the fort has seen heavy fighting in recent weeks.
Earlier this month, militants attacked Ladha fort but were also repelled. The military said between 40 and 50 insurgents were killed in that attack.
The increasing frequency of militant attacks underscores what analysts say is their rising control of the remote, mountainous area, where several top al-Qaida and Taliban militants are believed to be hiding out.