Pakistani and Afghan forces exchanged fire at their rugged border Sunday in their most serious skirmish in years. Pakistan claimed it killed six Afghan soldiers, but Afghanistan said just two Afghan civilians died.

Tension has been running high between Afghanistan and Pakistan, its eastern neighbor, over controlling the 2,430-kilometer (1,510-mile) border and stemming the flow of Taliban and Al Qaeda militants that stage cross-border attacks inside Afghanistan. Pakistan's move to fence parts of the disputed frontier has also angered Afghanistan.

Pakistan army spokesman Maj. Gen. Waheed Arshad accused the Afghan army of sparking the two-hour gunbattle with "unprovoked" fire at about six Pakistani border posts in Kurram Agency, a Pakistani tribal region opposite Afghanistan's Paktia province.

Troops from Pakistan's Frontier Corps returned fire and "six, seven" Afghans were killed, Arshad said, adding the Pakistani troops were able to see the casualties inflicted by looking across the border at Afghan posts a few hundred meters (yards) away. Three Pakistani troops were wounded, he said.

"This was unprovoked and without any reason," Arshad said.

On the Afghan side, Defense Ministry spokesman Gen. Mohammad Zahir Azimi accused Pakistani forces of encroaching 2 to 3 kilometers (1.2 to 2 miles) inside Paktia province's Jajai district.

"Border police tried to stop them, and the Pakistani army started firing heavy weapons toward the Afghan forces," he told a news conference.

Two school students were killed, and three students and two police were wounded, he said. Earlier, the chief of Afghan border police, Gen. Abdul Rahman, said five police were wounded.

Paktia Gov. Rahmatullah Rahmat said heavy weapons fire hit the village of Kubki and a school, bazaar and clinic in Gul Ghundi village, wounding villagers and students.

"The Pakistanis launched artillery, shot their guns, and they left behind civilian casualties in the area. It is a clear violation — crossing the border to attack Afghanistan," Rahmat said. He said Afghan forces only fired back with assault rifles.

Azimi claimed that thousands of local people had gone to join the Afghan forces after the clash, which he described as the worst in years between the two countries.

Asked about the Afghan claims, Arshad denied Pakistani fire had hit civilian targets.

The incident was likely to enflame the already acrimonious relations between the two key U.S. allies — just two weeks after a reconciliation meeting between Pakistan President Gen. Pervez Musharraf and Afghan President Hamid Karzai in Turkey where they agreed to jointly fight terrorism.

Afghanistan accuses Islamabad of harboring and helping supporters of the former Taliban regime ousted in late 2001, which Pakistan denies.

Pakistan says it has deployed about 90,000 troops to police the border, and last week announced it has completed a 20-kilometer (12-mile) stretch of the border fence in North Waziristan, another Pakistani tribal region.

Amid a long-running dispute over the demarcation of the border, Afghanistan rejects the fence. Last month Pakistani troops fired shots toward Afghan soldiers who Kabul said were trying to dismantle part of the fence. There were no reports of casualties.