The incident took place yesterday across Pakistan's Bajaur tribal region which touches Afghanistan's Kunar province.
A security official said that Afghanistan sought help from Pakistan after one of its soldiers was injured in a fire fight with rebels.
"Pakistani soldiers from a border post quickly responded and evacuated the wounded soldier," the official said.
The troops had to go more than half a kilometer inside Afghanistan to rescue the soldier who is undergoing treatment at a military hospital in Bajaur.