"Effective presence, vigilance and response repulsed terrorists attempt. In exchange of fire 5 soldiers were killed yesterday," the Inter Services Public Relations (ISPR) said in a statement.
Ten of the attackers were also believed to have been killed, the statement said.
"Last night terrorists from across the border attempted physical attack on three Pakistan border posts in Mohmand Agency," it said.
"Terrorists must be denied freedom of movement along the border," Pakistan army chief General Qamar Javed Bajwa was quoted as saying in the statement.
Also Read
Pakistan often accuses Afghanistan-based terrorists for the attacks in the country.
Last month, the Army has killed more than 100 suspected terrorists and also handed over to Afghanistan a list of 76 terrorists hiding across the border.
At the heart of the problem is Kabul's continued allegations against Pakistan for providing what it called 'safe havens' to terrorists launching the cross border raids, The Express Tribune reported.
Disclaimer: No Business Standard Journalist was involved in creation of this content