Pakistan's military says dozens of militants who sneaked into the country opened fire on troops in a former Taliban stronghold near the Afghan border, triggering a shootout that killed three soldiers.

The statement also said seven soldiers were wounded in Wednesday's attack in North Waziristan. The military claimed "scores of militants" were killed or wounded in the gunbattle, without providing details.

Pakistan and Afghanistan share a 2,400 kilometer-long border, which is about 1,500 miles. Both sides routinely accuse each other of failing to do enough to combat militant movement along the boundary that separates the two countries. The border was drawn by British rulers in 1896.

Kabul does not recognize the frontier as an international border and has objected to Islamabad's efforts to erect a fence along the boundary.