ISLAMABAD — Pakistan's military said seven troops were killed in separate incidents on Wednesday in the country's northwest, in a region along the Afghan border that until recent years had served as a base for Pakistani and foreign militants.

Six soldiers, including an officer, died in North Waziristan, when their army patrol struck two roadside bombs, while a seventh soldier was killed in a firing incident in the border Bajur region. The military said the shooting had come from the Afghan side of the frontier.

The attack in North Waziristan also wounded several others, and a second soldier was wounded in the Bajur attack on a border security post. No one immediately claimed responsibility for the attacks.

Both Bajur and North Waziristan are former tribal regions of the Khyber Pakhtunkhwa province.

Earlier this month, the Pakistani Taliban took responsibility for a powerful roadside bombing in North Waziristan that targeted a military vehicle, killing three soldiers and wounding four. Similar cross-border attacks in in July and September in Bajur killed two Pakistani soldiers.

Pakistan's border areas served as a base for the Pakistani Taliban and other militants until a few years ago, when the army claimed it cleared the region of insurgents, though occasional attacks have continued, raising fears the Pakistani Taliban are regrouping.

Pakistan and Afghanistan often accuse each other of turning a blind eye to militants operating along the porous frontier, which stretches about 1,500 miles across rugged mountainous terrain.

A United Nations report in July said more than 6,000 Pakistani insurgents were hiding in Afghanistan, most belonging to the Pakistani Taliban. Also known as Tehreek-e-Taliban Pakistan, they Pakistani Taliban are a separate insurgent group from the Afghan Taliban, although Pakistan's militant groups are often interlinked with those across the border.

Pakistan's military has been waging a decades old battle with the Pakistani Taliban, some of whom have aligned themselves with the region's Islamic State group's affiliate, headquartered in Afghanistan.

Two Pakistani soldiers were killed in a shootout with militants during a search operation in September, also in North Waziristan.