Recent high-profile attacks by Islamic militants on government targets, including a nearly successful assassination attempt on a senior army general last week, are pushing security forces into an escalating confrontation with extremist groups they once embraced as instruments of state policy, according to diplomats and analysts.

Until recently, Pakistani militants have avoided direct confrontation with the army, whose Inter-Services Intelligence agency, or ISI, has a long history of association with radical groups. The militants have seemed to distinguish between security forces and President Pervez Musharraf, an army general and supporter of the U.S.-led war on terrorism whom they twice tried to kill last December.

Over the past few months, however, some Islamic extremists now are seen to be broadening their anti-government campaign, according to the sources, staging frequent ambushes of army troops in the rugged borderlands near Afghanistan. In one high-profile attack on the morning of June 10, assailants sprayed automatic-weapons fire at the motorcade of Lt. Gen. Ahsan Saleem Hayat as he commuted to his office in downtown Karachi.

Ten Pakistanis, including the alleged ringleader, have been arrested in connection with that attempt, which was described by a Western diplomat as a "qualitative step up" in the nature of extremist violence in Pakistan.

At least in some instances, the army has apparently responded in kind, the sources said. After repeated attempts to persuade foreign militants and their local supporters in the remote tribal region of South Waziristan to surrender in exchange for amnesty, Musharraf and his generals last week ran out of patience, according to the diplomats and analysts. The military ordered a full-scale assault on fortified mountain compounds that for the first time included the use of airstrikes on targets inside Pakistan. Security officials claim to have killed more than 50 militants, mostly from Uzbekistan, in a four-day campaign in which 17 soldiers also died.

In subsequent fighting overnight Thursday, government troops who fired mortars at a mud brick fortress near the town of Wana in South Waziristan killed a prominent local tribesman and former Taliban fighter, Nek Mohammed, who was a key ally of the foreign militants, Pakistani officials said Friday. Mohammed, 27, had been the target of an intense manhunt since last week, when Pakistani authorities accused him of reneging on an agreement to hand over the militants.

The escalating bloodshed has prompted speculation among diplomats and analysts about the possibility of an irrevocable breach between the security services and home-grown radical groups -- some linked to al Qaeda -- that Pakistan has long employed as a kind of irregular army. They were used first to help drive Soviet troops from Afghanistan and more recently to bleed Indian forces in the disputed Himalayan province of Kashmir.

The assassination attempt last week in Karachi, said Rifaat Hussain, who chairs the department of strategic studies at Quaid-i-Azam University in Islamabad, "was an attack on a symbol of the authority of the state itself." He added, "Whoever planned it, the idea was not just to kill a person but to bring home the realization that the state itself was vulnerable and a legitimate target. . . . It was a kind of blowback."

Apparently, some senior security officials have reached the same conclusion.

"The fact of the matter is that almost all of the major terrorist incidents reported in the country recently were traced back to local militants who at one time or another had rubbed shoulders" with Pakistani intelligence agencies, said a senior intelligence official who requested anonymity because of the sensitivity of the topic. The official cited major attacks by such groups, including the killing of Wall Street Journal reporter Daniel Pearl in February 2003. "Be it the murder of Daniel Pearl, assassination attempts on General Musharraf or a classic guerrilla-style attack against the corps commander in Karachi, the jihadis are directly involved."

Consistent with recent peace talks between India and Pakistan, Indian officials say that Musharraf seems to be honoring his pledge to prevent the use of Pakistani territory as a base for militant attacks on Indian forces in Kashmir. "There has not been much infiltration, to be honest," acknowledged an Indian intelligence official in New Delhi whose agency does not permit him to be named. "The overt help of the Pakistani army in infiltration is not happening."

At the same time, the official said, the "infrastructure" used by fighters from groups such as Lashkar-e-Taiba "has not been totally dismantled." The official alleged that militants have started to reoccupy tent camps in a forest near the city of Muzzafarabad that has traditionally served as a jumping-off point for incursions across the cease-fire line that separates Indian and Pakistan forces in the divided province.

Pakistani officials deny such camps exist. But they acknowledge some reluctance to move too quickly or harshly against the home-grown groups, especially at a time of rising public anger toward the United States.

"It's a long haul, frankly," said a senior official who meets regularly with Musharraf and spoke on condition he not be named. "One has to move with tact. Unfortunately, the policies in Iraq, the policies in Palestine, have generated a sentiment against the U.S. among the average Muslim, which has been exploited by these groups."

But Pakistani officials no longer attempt to deny the internal threat posed by groups such as Lashkar-e-Taiba and Jaish-i-Muhammad, which was founded with the government's blessing in 2000 to support the Kashmir insurgency and also has provided help for the Taliban, according to Western diplomats and analysts.

For example, Jamil Ahmad, a Jaish member from Pakistan-held Kashmir who fought against U.S.-led coalition forces in Afghanistan, was captured by pro-American Afghan forces and later handed over to Pakistani authorities, according to Pakistani security officials. Ahmad was then released. He has since been identified as one of two suicide bombers who tried to ram explosive-laden pickup trucks into Musharraf's armored limousine on Dec. 25, 2003.

Ataur Rahman, the alleged mastermind of last week's attack on Hayat, the corps commander in Karachi, has also fought in Kashmir and with the Taliban in Afghanistan, said police and intelligence officials. About 30 years old, Rahman comes from a middle-class neighborhood in Karachi, speaks good English and holds a master's degree in statistics from Karachi University, the officials said.

As they described the assassination attempt, Rahman and his co-plotters spent about a month watching Hayat's comings and goings before they finally made their move, firing on his motorcade and detonating a roadside bomb as the army general traveled from home to office on his customary route.

Hayat, who commands one of Pakistan's nine army corps, survived the attack only because his driver, though fatally wounded in the head, managed to stamp on the accelerator while an aide reached over the back seat and steered the general's bullet-riddled Toyota passenger car out of the line of fire, according to police and intelligence officials who insisted on anonymity because the matter is still under investigation. A bystander and nine security personnel, including Hayat's driver, were killed.

Police subsequently found and defused a second bomb, which was equipped with a trigger made from a cell phone. They arrested Rahman and his alleged accomplices over the next two days after tracing the origin of a call to the cell phone that apparently had been intended to detonate the device.

An investigator who was present for Rahman's interrogation said the accused man showed no remorse. "For us, the army is now the target," the investigator quoted Rahman as saying. Rahman, who allegedly received training at a militant camp in South Waziristan, explained that he and his associates now consider it an obligation "to wage war against the Pakistani army for siding with infidel forces such as the United States," the investigator said.

Western diplomats also cite evidence that the army is becoming more aggressive in South Waziristan, long regarded as a possible refuge for Osama bin Laden and other senior al Qaeda figures. During the recent campaign there, Pakistani F-16s dropped precision-guided bombs on compounds thought to have been used by foreign militants in the Shakai Valley. Commandos from the army's elite Special Services Group completed the job on the ground.

By some reckonings, the militants' attack on the corps commander might have marked a turning point. "It represents a qualitative step up in the terror effort," said a Western diplomat who spoke on condition of anonymity. "Actually taking on the army as an institution may be the one thing that provokes a more robust backlash."

Special correspondents Kamran Khan in Karachi and Rama Lakshmi in New Delhi contributed to this report.

A funeral procession for tribal leader Nek Mohammed, killed by government troops, proceeds to a graveyard in Pakistan's remote area of South Waziristan. Pakistani paramilitary soldiers guard a post on the outskirts of Wana, a town located in an area long regarded as a possible refuge for al Qaeda figures.