The incident took place Saturday night in the town of Harnai, around 170 kilometres (105 miles) east of Quetta, capital of the Balochistan province which borders Afghanistan and Iran.
The Pakistani military has been fighting a low-level insurgency for decades in the province.
“During the intense exchange of fire, seven brave soldiers embraced shahadat (martyrdom) while repulsing raiding terrorists,” the military said in a statement.
There was no immediate claim of responsibility for the attack.
Ethnic Baloch separatists have been waging an insurgency for years in the region, which is also riven by Islamist and sectarian violence.
Pakistan has long blamed India for backing Baloch separatists.
Balochistan is also a major part of a Beijing-backed multi-billion-dollar infrastructure drive known as the China-Pakistan Economic Corridor (CPEC).
Baloch separatists have also previously claimed attacks on CPEC projects, and thousands of Pakistani security personnel are deployed in the region to counter the violence.
COMMENT DISCLAIMER: Reader comments posted on this Web site are not in any way endorsed by Manila Standard. Comments are views by manilastandard.net readers who exercise their right to free expression and they do not necessarily represent or reflect the position or viewpoint of manilastandard.net. While reserving this publication’s right to delete comments that are deemed offensive, indecent or inconsistent with Manila Standard editorial standards, Manila Standard may not be held liable for any false information posted by readers in this comments section.