The skirmish, which took place in the Ghaljo area of the northwestern Orakzai tribal region, began when militants ambushed a military patrol.
Officials said 18 soldiers were wounded in the ambush.
The death toll could not be independently verified, and militants often dispute official figures.
The military has been conducting operations against militants in Orakzai for months.
Several militant groups are active in the northwestern semi-autonomous tribal regions, near the border with Afghanistan, including the Tehreek-i-Taliban Pakistan (TTP), responsible for many of the bombings across the country in recent years.
COMMENTS (6)
Comments are moderated and generally will be posted if they are on-topic and not abusive.
For more information, please see our Comments FAQ
It is sad to hear that the independence day of Pakistan was turned into a day of mourning for the families of 5 soldiers. We commend the bravery of these soldiers who killed 20 militants before losing their lives. Our condolences go out to the friends and families of the soldiers in this difficult time. The terrorists continue to reveal their evil plan by waging these attacks on Pakistani soil. We fully support Pakistan in its fight against terror. We must use our renewed alliance and go after these terrorists from all sides. We are confident of restoring peace in the region by combining our strength.
Capt. Joseph Kreidel DET-United States Central Command www.centcom.mil/ur
Happy independence day to relatives of the soldiers who got killed.
T his news is will encourage othe r groups to kill and maim the soldiers.
When Indian ro American (and now even Chinese) say that Pakistan has terrorists in its territory, it asks for "proof" and what not......
Those who ride Tiger end up inside its stomach! Those who keep snakes in their backyard (so that neighbour DARE not argue) usually get bitten by the same....
Feel sad for the families of those Soldiers becuase they end up suffering due to lofty "strategies" of the elite!
A gift to the nation on Independence day!