ISLAMABAD, Pakistan -- Secretary of State Colin L. Powell assured Pakistan yesterday that moderate elements of the Taliban could be included in a future broad-based Afghan government, apparently trying to make support for the United States more politically acceptable here.

In return, Pakistan's president, Gen. Pervez Musharraf, pledged to back the U.S. military campaign for as long as necessary, despite violent public opposition to the airstrikes on neighboring Afghanistan.

"To the extent that [the Taliban] are willing to participate in the development of a new Afghanistan where everybody is being represented, we would have to listen to them or at least take them into account," said Powell, speaking from the presidential palace in Islamabad. "You can't export them. You can't send them to another country."

The secretary's remarks were designed to reassure Pakistan, which helped create the Taliban and now fears the emergence of a hostile regime on its western border. The comments may also have been intended for the ears of moderate members of the Taliban leadership who might be considering defection.

"We certainly will carry on cooperating so long as the operation lasts," said Musharraf, who said he hoped the campaign would be brief and targeted. "We would like to see this operation terminated as fast as possible, and that is what I would urge the coalition:

"Achieve the military objectives and terminate the operation."

Powell is visiting Pakistan and India this week to shore up support for the U.S. military effort and to urge restraint between the two archenemies during a volatile period in the region. In his news conference with Musharraf, Powell urged Islamabad and New Delhi to begin a new round of negotiations to avoid further hostilities at a time when stability and cooperation are paramount.

"Above all, a beginning of the dialogue between the two sides is the most important thing needed now, and that is the message I will also be taking to India," said Powell, who arrived in New Delhi last night for meetings today with Indian Prime Minister Atal Bihari Vajpayee.

As U.S. bombing runs continued on the Afghan cities of Kabul, Kandahar and Mazar-e Sharif, India and Pakistan engaged in a second day of fighting. The eruption of their long-simmering dispute threatened to distract attention and energy from the U.S. military campaign.

Indian Defense Minister George Fernandes said Indian soldiers killed 30 Islamic militants who were trying to cross a cease-fire line that divides Pakistani- and Indian-administered areas of Kashmir. Pakistan said Indian forces had killed a woman and wounded 25 other civilians.

India and Pakistan, both nuclear-armed powers, have fought two wars over Kashmir, and India has been worried that the United States would side with Pakistan as a reward for its support on the Afghan issue.

The conflict, Powell said, "must be resolved in accord with the wishes of the Kashmir people."

India has accused Pakistan of supporting Islamic terrorists operating in predominantly Muslim Kashmir. Pakistan says it provides only diplomatic and moral support for what it calls "freedom fighters."

As Powell made his way toward India yesterday, officials in New Delhi were already criticizing his comments. India vehemently opposes the involvement of a third country in negotiations with Pakistan. Yesterday, Indian officials said the central issue was not Kashmir, but Pakistani-sponsored terrorism there.

"There should be no confusion between cause and effect," said Indian Foreign Ministry spokeswoman Nirupama Rao. "The present situation in Jammu and Kashmir is a consequence of state-sponsored terrorism and not its cause."

After many months of relative calm along the cease-fire line, fighting broke out Monday when Indian soldiers shelled Pakistani positions. The attack came a little more than two weeks after a car bomb killed 40 people in an attack on the Jammu and Kashmir state legislature in the Indian-controlled area. Jaish-e-Mohammed, a Pakistan-based militant group, first claimed responsibility for the bombing and later denied it.

While the United States has urged India not to take advantage of the war along Pakistan's border with Afghanistan, Indian officials have vowed to fight back if terrorist strikes continue.

"India will be ruthless in dealing with infiltrators and the kind of methods used by them, like laying of mines, killings ... getting into suicidal exercises," said Fernandes, the defense minister.

In Pakistan, Powell lavished praise on Musharraf for taking a bold stand against international terrorism and for supporting the attack on Afghanistan despite opposition from Pakistanis who feel a sense of kinship with their Muslim neighbors.

Powell promised to help garner support for relief of Pakistan's crippling debt and pledged that the new alliance between the two countries would be a lasting one.

Pakistanis take a wary view of their nation's new friendship with the world's lone superpower. The United States used Pakistan to fight a proxy war against the Soviet Union in the 1980s in Afghanistan. After the Soviet retreat in 1989 and the collapse of communism, the United States abandoned Pakistan, engendering a bitterness and mistrust that continues today.

Musharraf has come under increasing public pressure in his country after reports of civilian injuries and deaths in Afghanistan from the U.S. air raids.

The Pakistani president's continued support is an essential component in the U.S. campaign to capture Osama bin Laden and to crush the Taliban.

Pakistan, which shares a 1,500-mile border with Afghanistan, has permitted the United States to fly air raids over its territory and has promised to provide intelligence and logistical support.

Wire services contributed to this article.