The attack took place on Thursday night in Tank district of Khyber Pakhtunkhwa province, which shares a border with Afghanistan.

The Pakistan Army said 12 militants were also killed during retaliatory action following the attack.

Militants used an explosive-laden vehicle

According to the military, the attackers attempted to breach the security installation by driving an explosives-packed vehicle into the outer wall of the checkpoint.

"The attackers rammed an explosive-laden vehicle into the perimeter wall," the army said in a statement, adding that the blast caused severe damage to the infrastructure of the post.

The military described those killed in the attack as "brave sons of soil", saying the victims included 12 soldiers, two police personnel and a government official from the former forest department.

Tehreek-e-Taliban Pakistan claims responsibility

The Tehreek-e-Taliban Pakistan (TTP), also known as the Pakistani Taliban, claimed responsibility for the assault.

In a statement, the group said four suicide bombers were involved in the attack.

Militant violence has increased sharply in northwestern Pakistan in recent months, particularly in Khyber Pakhtunkhwa and parts of Balochistan.

Pakistan-Afghanistan tensions rise over militancy

Pakistan has repeatedly accused militants based in Afghanistan of carrying out attacks inside its territory, a claim denied by Afghanistan's Taliban government.

The allegations have deepened tensions between the neighbouring countries, with Pakistan carrying out airstrikes inside Afghanistan, saying they targeted militant hideouts.

The Taliban government and the United Nations have said several civilians were killed in Pakistani strikes in eastern Afghanistan in June.

Long-running conflict with TTP

The TTP has been waging an armed insurgency against the Pakistani state since 2007, seeking to overthrow the government and impose its interpretation of Islamic law.

Islamabad alleges that the group uses safe havens in Afghanistan to train fighters and plan attacks, while Kabul maintains that militancy inside Pakistan is an internal security issue.