ISLAMABAD - Pakistan says "terrorists” from across the Afghan side of the border raided an outpost Friday, killing at least three soldiers.

An army spokesman said personnel of the paramilitary Frontiers Corps were constructing a new border post in the Mohmand tribal region when they came under attack.

Major-General Asif Ghafoor said Pakistani troops killed five of the assailants and wounded many more in retaliatory fire.

"Fleeing terrorists were seen carrying back dead bodies and injured,” Ghafoor added. He said Pakistan is "paying the price" for Afghan forces’ lack of capacity and "ungoverned spaces” in Afghanistan.

The general was referring to U.S. military assessments that put more than 40 percent of Afghan territory beyond Kabul's control.

Dozens of Pakistani security forces have been killed or injured in cross-border raids in recent months.

The Pakistani army is constructing new posts and building a fence on its side of the long, porous border with Afghanistan to deter the violence. Islamabad says militants linked to the outlawed Pakistani Taliban have taken refuge in Afghan border areas after fleeing anti-terrorism military operations in Pakistan.

Officials also maintain Afghans have not deployed enough forces on their side and a nearly 700-kilometer portion of the 2,600 kilometer frontier is unguarded on the other side, encouraging fugitive anti-state militants to stage cross-border attacks on Pakistani posts.

Afghan and U.S. officials say Pakistan is to blame for harboring Taliban sanctuaries on its soil. U.S. Vice President Mike Pence, on a surprise visit to Afghanistan Thursday, urged Islamabad to end support to the insurgents.

"Pakistan has much to gain from partnering with the United States and Pakistan has much to lose by continuing to harbor criminals and terrorists,” Pence said while addressing U.S. troops at Bagram Airfield.

General Ghafoor rejected the allegations, saying Pakistan and the U.S. are jointly fighting terrorism and that "allies don't put each other on notice.” He said both sides need to enhance intelligence-sharing cooperation and remain engaged in diplomacy to finding "common ground” for moving forward.