An Afghan defence ministry spokesman General Mohammad Zahir Azimi said the fighting started early on Sunday after Pakistani soldiers moved into positions on hills in Afghanistan's Paktia province.
The soldiers had pushed up to four kilometres (two miles) into Afghanistan, spokesman said, adding the Afghan army despatched several units, including tanks and artillery to the area.
Thousands of angry Afghan tribesmen were moving towards the battle zone and preparing to fight alongside the Afghan soldiers, Azimi said. Some were carrying Afghan national flags, shouting "Allah-O-Akbar" (God is great) and banging drums traditionally used to herald battle, he said. "They've said they're ready to join our troops," Azimi said.
Pakistani choppers were circling over the area, which is in Jaji district, about 120-km south-east of Kabul. "Today at seven in the morning... the Pakistani military deployed forces in the hills of Goye of Jaji district that faced border police resistance," Azimi said.
"Pakistani forces began firing heavy weapons. Police returned fire with light weapons. The fighting is ongoing." Afghanistan was trying to resolve the issue diplomatically, he said, adding: "If we are invaded, we will have no other choice but to defend ourselves. We'll use whatever we have in hand."
Paktia Governor Rahmatullah Rahmat told AFP the fighting erupted when Pakistani troops fired on Afghan border police building, a security post, on the disputed frontier.
"Two school children were killed when a Pakistani rocket landed in their school, and a police officer and another civilian were also killed by Pakistani rockets," Rahmat said.
Pakistan Military Spokesman Maj-Gen Waheed Arshad said the Afghan side had opened fire 'unprovoked' on a check-post in Kurram tribal district. "Our troops retaliated the fire in which six to seven Afghan soldiers who were firing at our post were killed and three of our troops were injured," Arshad said. The Afghan side rejected his claim of military deaths.
"We will give a stern reply if such an incident of firing takes place in future," Arshad said. The clash was the second in less than a month. On April 19, security forces from both sides fought for several hours after Afghans tore down part of a fence being erected by Pakistan. No one was hurt. Pakistan says it is putting up the fence to stop the cross-border movement of militants involved in the Taliban-led insurgency in Afghanistan.
An official said last week that it had completed 20-km of the fence. The Afghan government strongly objects to the barrier, saying it will not help stop the rebels crossing into the country but will separate tribes that straddle the frontier.
Also, Afghanistan does not accept the border, which it calls the Durand Line. The frontier was drawn up colonial Britain in 1893.