The Pakistan Army said the "phased fencing of entire Pakistan-Afghanistan border has commenced".
Pakistan shares a long and porous border with Afghanistan, which runs through mountainous terrain and is largely unpatrolled. The Durand Line was drawn by the British rulers in 1896 and is disputed by Afghanistan, which also resists Pakistani attempts to erect any border fence.
Due to a lack of policing, border skirmishes have often led to escalation in tension between the two countries. In May, at least 15 people were killed and dozens wounded after a hours-long cross-border firing between Pakistani and Afghan forces.
The decision to fence the selective parts of the border was taken some time ago as part of initiatives to curb infiltration by militants.
In addition to fencing, the Army and paramilitary Frontier Corps Khyber-Pakhtunkhwa were constructing new forts and border posts to improve surveillance and defence.
"A secure Pakistan-Afghanistan border is in common interest of both countries and a well-coordinated border security mechanism is essential for enduring peace and stability," said the Pakistani Army.