Wednesday's statement from the ministry says it has summoned a top Afghan official to lodge a strong protest over the incident, which occurred on Tuesday in the North Waziristan tribal region.
Two local Pakistani intelligence officials also confirmed the attack, saying the mortars fired by the Afghan forces landed near the Ghulam Khan border town, killing two.
The officials spoke on condition of anonymity as they were not authorized to speak to the media.
The two countries have traded accusations in the past, with each side accusing the other of not doing enough to keep militants from crossing the porous border.
Afghan officials declined to comment.