Updated

Suspected militants on a motorbike fatally shot a senior army officer and a soldier in the Pakistani capital Thursday, striking at security forces as the military wages a major anti-Taliban offensive in the northwest.

Civilians fleeing the army operation in South Waziristan said Taliban fighters were roaming freely through much of the area and digging in their positions, a sign of tough battles ahead.

The new South Waziristan offensive is considered a critical test of nuclear-armed Pakistan's campaign against Islamist extremists blamed for attacks inside the country and on Western forces in neighboring Afghanistan.

Thursday morning's attack in Islamabad was the latest in a wave of militant attacks that have killed more than 170 people across the country over the past three weeks.

The two gunmen fired on an army jeep in a residential area of the capital, police official Zaffar Abbas said. A soldier and a brigadier — a high-ranking army officer — were killed, while the driver was wounded, authorities said.

"Terrorists and extremists are behind this," Islamabad's top police officer, Syed Kalim Imam, told reporters.

The United Nations identified the slain officer as Ahmed Moinuddin, deputy commander of the U.N. peacekeeping mission in Sudan. He had joined the U.N. mission five months ago and was on leave in Pakistan.

Ashraf Qazi, the top U.N. envoy for Sudan, strongly condemned "the barbaric killing."

The Pakistani military is advancing on multiple fronts in South Waziristan. The exodus from the region has intensified since the ground offensive's launch on Saturday, and more than 100,000 people are said to have been displaced so far.

More than 300 tired and dusty refugees lined up to register for aid Thursday at one center in Dera Ismail Khan, a gritty town not far from the tribal belt.

"We saw no ground forces on the way, not even any movement except helicopters and airplanes. But we saw a lot of Taliban movement," said Awal Jan, a refugee from Sarwakai town. "They were roaming around on their vehicles and digging trenches in the mountains."

Baton-wielding police beat back refugees crowding an aid distribution center run by Pakistani authorities in Paharpur town, some 30 miles outside Dera Ismail Khan. The lines to the center were long, and some refugees tried to climb the facility's wall to get inside. Associated Press reporters saw an old man with a bloodied head.

"We came here for bread, but the police beat us up," said Rahmatullah Mehsud, one of the injured. "There, the Taliban were messing with things and the army was showering bombs. Here, we have to bear the clubs."

Aid administrator Javed Shaikh said there was plenty of food, but that the refugees were "impatient."

"There are some policemen deployed who are fed up with the indiscipline of the people," he said.

Over the past few days, the army has been fighting for control of Kotkai, the hometown of Pakistani Taliban chief Hakimullah Mehsud.

The battle for Kotkai is strategically important because it lies on the way to the major militant base of Sararogha.

An army statement Wednesday said forces were engaged in "intense encounters" in hills surrounding Kotkai and had secured an area to its east. Army spokesman Maj. Gen. Athar Abbas said there was no significant fighting inside the town yet.

The army believes Mehsud and his deputy, Qari Hussain, remain in the region directing militants' defenses.

An army statement Thursday reported two more soldiers were killed, bringing the army's death toll to 18, while 24 more militants were slain, bringing their death toll to 129.

It is nearly impossible to independently verify information coming from South Waziristan because the army has closed off all roads to the region. Analysts say both sides have exaggerated successes and played down losses in the past.

The army has deployed some 30,000 troops to South Waziristan against about 12,000 Taliban militants, whose ranks include up to 1,500 foreign fighters, many of them Uzbeks.