Kabul's Foreign Ministry said no one was wounded in the incident, which occurred in the same place where a firefight erupted between Afghan and Pakistani forces, killing an Afghan border policeman and wounding two Pakistani soldiers last week.
During that incident, a border gate built by Pakistan was damaged in the fighting, and Afghanistan had warned Pakistan not to repair it.
A spokesman for the Pakistan Foreign Ministry, Aizaz Ahmad Chaudhry, said a Pakistani military post near the border came under fire from Afghanistan Monday morning and one of the Pakistani troops was injured.
He said it was not clear who fired on the post. He did not comment on the Afghan protest.
"That post has been under attack for some time now," he said. "We believe that the posts are needed for border management."
More than 1,000 people staged an anti-Pakistan demonstration Monday morning on the outskirts of Kabul to protest last week's incident.
Relations between the two neighbors have been severely strained in recent months, and the mountainous region where the latest shooting took place has seen acrimonious exchanges between the two sides over the demarcation of their border.
Afghan President Hamid Karzai charged last month that Pakistan was setting up a border gate in the Goshta district without asking Kabul's permission.
It remains unclear how they would do that as Pakistan claims the facility is on its territory. But Afghanistan does not recognize the disputed Durand Line, the 19th century demarcation between present-day Afghanistan and Pakistan as its border. Pakistan accepts the line as the boundary between the two sides.
"Since the Durand Line has been imposed on Afghanistan, it was not acceptable to the Afghans and we cannot accept the Durand Line," Karzai said last week. "No government in Afghanistan will accept the Durand Line."
The Afghan Foreign Ministry said in a statement that the ranking Pakistani diplomat in Kabul was called in and a "strong protest" was lodged "about the unprovoked attack by Pakistani forces that used both heavy and light weapons against Afghan forces near the Durand Line in Goshta district, Nangarhar province this morning."
The two neighbors often trade accusations that each side is firing across the border, and Pakistan has said in the past that it is targeting insurgents who are seeking to enter its territory.
Accusations made by Afghan officials that Pakistan is allegedly trying to torpedo efforts to start peace talks with the Taliban have also contributed to deteriorating relations.
Both countries have also accused each other of providing shelter for insurgents fighting on the other side of the border.
Afghanistan has been deeply suspicious of the motives of Islamabad, which long backed the Taliban regime and has since seemed unable or unwilling to go after militant leaders taking refuge inside its borders.