ISLAMABAD, Pakistan — The Pakistani military, long reluctant to heed American urging that it attack Pakistani militant groups in their main base in North Waziristan, is coming around to the idea that it must do so, in its own interests.

Western officials have long believed that North Waziristan is the single most important haven for militants with Al Qaeda and the Taliban fighting American and NATO forces in Afghanistan. Pakistan has nurtured militant groups in the area for years in order to exert influence beyond its borders.

The developing shift in thinking — described in recent interviews with Western diplomats and Pakistani security officials — represents a significant change for Pakistan’s military, which has moved against Taliban militants who attack the Pakistani state, but largely left those fighting in Afghanistan alone.

That distinction is becoming harder to maintain, Pakistani and Western officials say, as the area becomes an alphabet soup of dangerous militant groups that have joined forces to extend their reach deeper inside Pakistan.

The consensus is gathering against a background of improved United States-Pakistan relations. The Obama administration’s efforts with Pakistan are beginning to bear fruit, officials said, while the countries’ armies have begun working together more closely, particularly since Pakistan stepped up its military efforts, according to a Pentagon report to Congress released this week.

Even so, any operation in North Waziristan by Pakistan’s badly stretched military would still be months away, Pakistani and Western officials said. And even if it is undertaken, the offensive may not completely sever Pakistan’s relationship with the militants, like Sirajuddin Haqqani, who serve its interests in Afghanistan.

The area has long been a sanctuary for Mr. Haqqani, a longtime asset of Pakistan’s military and intelligence services who is also one of the most dangerous figures in the insurgency against American forces.

In recent months, however, it has also become home to Hakimullah Mehsud, Pakistan’s enemy No. 1, who is now believed to have survived an American drone strike in January, according to the Western diplomat and Pakistani intelligence officials.

He and his supporters fled a Pakistani military operation in South Waziristan that began last October. Though Pakistan’s military said the operation was completed last month, its soldiers are still dying there in rising numbers, as Mr. Mehsud and his forces strike at them from their new base. In recent weeks, at least 19 soldiers have been killed in areas where the military had all but claimed victory.

To make matters worse, families who left during the operation are reluctant to return to their homes, saying they are afraid of vengeful leaders still at large.

“They know a lot of these guys have fled to North Waziristan,” said a Western diplomat in Islamabad. “That’s patently obvious. And sooner or later,” the diplomat continued, “they’re going to have to go in there.”

Photo

Bodies of the victims of a bomb attack on Wednesday in Peshawar. Pakistan is considering attacking militant bases in North Waziristan.Credit
Fayaz Aziz/Reuters

In a separate interview, a senior Pakistani official concurred. “The source of the problem is in North Waziristan, and it will have to be addressed,” said the official, who spoke on the condition of anonymity, because he was not allowed to speak publicly.

The growing consensus on North Waziristan comes after a year in which the Pakistani military has opened several fronts against the Taliban in Pakistan, beginning with a campaign in the Swat Valley last spring.

The fighting has cost Pakistan about 2,700 soldiers since 2001, nearly triple the total number of Americans killed in Afghanistan in the same period.

Militants struck back, hitting the military’s headquarters in Rawalpindi, a mosque where military families prayed, and the offices of Pakistan’s intelligence agencies in three cities. The number of Pakistani civilians killed last year in Taliban attacks exceeded civilian deaths even in Afghanistan, helping shift public opinion against the militants.

“I think it has become very dramatic that these people are out after them,” the diplomat said.

The fighting — coupled with intense American drone strikes in the western tribal region — has splintered the militant groups, which are now a poisonous mix of Pashtun tribesmen, Arabs, Uzbeks and ethnic Punjabis, known for their brutality against Shiites and their close links to Al Qaeda.

The fracturing is so profound that one Pakistani government official in the tribal region said that the Pakistani Taliban now consisted of several parts operating independently, and that the groups “do not necessarily take orders from Hakimullah Mehsud.” But the widening military campaign has also given them common cause. Operations by the militants have become more fluid. “All these groups are helping each other out and selling their services to the highest bidder,” the diplomat said.

Pakistani officials recognize that the evolving nature of the militants has made them more dangerous — and made the necessity of going after them in North Waziristan increasingly unavoidable. “Their nexus with the Punjabi Taliban have given them greater reach,” a Pakistani law enforcement official said.

But even as there is a growing consensus that North Waziristan is now the source of the problem, there is a continuing debate in the military over when and how to tackle it. Publicly the Pakistani military is saying that it is already fighting on several fronts, and that it does not have the resources to push into North Waziristan for at least several months. Western officials say they believe that the Pakistani military is doing as much as it can under the circumstances.

There is also an understanding that opening a new front in North Waziristan — with its tangle of tribes, Qaeda militants, antistate groups and Haqqani supporters, thought to be in the thousands — will be a formidable task. “To go after Haqqani, it takes a very sizable military operation,” the diplomat said.

But some officials say an operation could come sooner, not least because officers on the ground are calling for it. More frequent attacks emanating from North Waziristan “are likely to lead to a reaction sooner rather than later as field commanders feel the pressure to protect their troops,” said Shuja Nawaz, director of the South Asia program at the Atlantic Council in Washington.

Others argue that Pakistan should wait and see how the American-led military offensive in southern Afghanistan plays out this summer. One senior military officer who favors Pakistani military action sooner derisively called that option “sitzkrieg,” Mr. Nawaz said.

Whatever the case, the military would most likely avoid a frontal invasion, some officials suggested, and instead bolster the forces it already maintains in the area, about 10,000 soldiers. Pakistani forces in North Waziristan, which include the paramilitary Frontier Corps, are mostly confined to their barracks.

Despite the prospect of a shift on North Waziristan, there is no apparent change in Pakistan’s attitude toward the leadership council of the Afghan Taliban, which manages the insurgency from in and around the city of Quetta, in southwest Pakistan, several diplomats said.

The Afghan Taliban, under Mullah Muhammad Omar, remains Pakistan’s main tool for leverage in Afghanistan. The arrest of the Taliban’s top operational commander, Abdul Ghani Baradar, in January has not led to a broader crackdown against the Afghan insurgents. “Does it indicate a shift in policy?” the Western diplomat said, referring to the arrest of Mr. Baradar. “No. But it’s still a good thing.”

A version of this article appears in print on April 30, 2010, on page A1 of the New York edition with the headline: In Shift, Pakistan Considers Attack On Militant Lair. Order Reprints|Today's Paper|Subscribe