Updated

PESHAWAR, Pakistan -- Some 200 militants streamed over the border from Afghanistan and attacked a nearby Pakistani checkpoint on Wednesday, killing at least five security troops, police said.

The incident in Upper Dir district underscores the dangers posed by the porous nature of the Pakistan-Afghanistan border, which both countries have struggled to control as a means of stopping al-Qaida and Taliban-led insurgent movements who have ties on both sides of the boundary.

The attack is the latest bloodshed as the Pakistani Taliban and affiliated groups carry out threats to avenge the May 2 U.S. raid that killed Osama bin Laden in Pakistan's northwest. But it is more likely a reaction to ongoing Pakistani military offensives against insurgents along the border.

Upper Dir lies just outside of Pakistan's tribal areas, but it, too, has witnessed al-Qaida and Taliban militant activity, and the Pakistani military has carried out operations there in the past. The area is remote and dangerous, making it difficult to independently verify information.

Local police official Bahadur Khan said Wednesday's attack began around noon. A shootout was still ongoing an hour later at the scene in Shaltalo town, which borders Afghanistan's Kunar province.

The U.S. has lauded Pakistan's operations against insurgents, which have been carried out primarily in the semi-autonomous tribal areas and targeted militants attacking the Pakistani state.

But Pakistan has, at least publicly so far, resisted American appeals to stage an offensive in the North Waziristan tribal region, the primary haven for militant groups that attack U.S. and NATO forces across the border in Afghanistan.