ISLAMABAD: Taliban fighters attacked several Pakistani military posts along the Afghan border Saturday, sparking an hourslong gun battle that included Pakistan launching airstrikes into Afghanistan, authorities said. Pakistan said soldiers killed 16 militants, while Afghan officials said the airstrikes killed five civilians.

The fighting was the latest cross-border attack along the volatile and porous Pakistan-Afghanistan boundary and again tests the two countries' already uneasy relations.

Two Pakistani military officers blamed the local Pakistani Taliban for the attack, saying dozens of fighters from the group crossed into Pakistan overnight to stage the attack.

The insurgents attacks at least two military checkpoints in the northwestern tribal region of Bajur, killing one soldier and wounding two others, local government official Shah Naseem said. Naseem said the heavily armed attackers also targeted several military posts in the border village of Nao Top, about 50 kilometers (30 miles) northwest of Khar, the main town in Bajur.

The army responded, sending helicopter gunships into battle as troops chased the attackers. The assault killed 16 insurgents, the two army officers told The Associated Press. The attackers then fled toward Afghanistan, the officers said, speaking on condition of anonymity because they were not authorized to talk to journalists.

The officers said their intelligence suggested the attack local Pakistani Taliban fighters launched the attack. They said the fighters, originally from the Bajur tribal region and the northwestern Swat Valley, have been hiding in the village of Ghund in neighboring Afghanistan's Kunar province.

Gen. Abdul Habib Sayedkhaili, the provincial police chief of Kunar province, said two Pakistani helicopters crossed into his country and opened fire in Dangam district. Their attack killed five Afghan civilians and wounded 10, Sayedkhaili said.

Sayedkhaili said Pakistani forces fired mortar shells into Afghanistan throughout the day Saturday.

Afghanistan and Pakistan share a 2,250-kilometer (1,400-mile) border and militants from both sides routinely launched cross-border attacks before fleeing back into their other country. The border area is remote and off limits to reporters, making it difficult to independently confirm information about fighting or military operations in the tribal regions.

Mortar attacks and other military operations routinely strain relations between Afghanistan and Pakistan. Afghan President Hamid Karzai long has accused Pakistan of sheltering Taliban militants and other extremists.

The Pakistani Taliban have killed thousands of people in an attempt to impose Islamic law in Pakistan and end the government's support for the U.S.-led war in neighboring Afghanistan.

Pakistani Prime Minister Nawaz Sharif has made negotiations with the Taliban a centerpiece of his government. Supporters of the peace talks argue that negotiations are the only way to end the cycle of violence while critics say a deal will only strengthen militant ranks, allow them to regroup and strike back with more force.