In response to the U.S. attack on Afghanistan, protests in Pakistan have been smaller than anticipated, and President Pervez Musharraf appears firmly in charge. In fact, the crisis may have strengthened him. But he and others say if the war goes on too long, public opinion could turn against him.

Pakistani President Pervez Musharraf has used the outbreak of war to transform his own government, says Stephen Cohen, senior analyst of South Asia at the Brookings Institution.

"He has consolidated his position as the effective leader of Pakistan. It is no longer a consortium or a junta," he said. "It is General Musharraf, who has emerged as a leader in his own right and not simply as a spokesman for a group of other generals."

In offering Pakistani intelligence and air space to U.S. forces, the President risked offending religious parties and military men sympathetic to the Taleban and its strict version of Islam. But once he was warned of the impending U.S. attack, he put a leading hard-line mullah under house arrest and replaced some generals.

In a military government, the military has done its duty, says Teresita Schaffer, a former top U.S. diplomat dealing with South Asia. They have kept demonstrations from getting out of control, though there was some rioting and arson in the city of Quetta.

She says it was especially important to remove the director of ISI (Inter Service Intelligence), which has been closely associated with the Taleban and operates with considerable independence. "This has got to be an effort to impose greater control on ISI, which has been the home base for Pakistan's friends in Afghanistan, not just in recent years but going way, way back," said Ms. Shaffer.

In turning against the Taleban, President Musharraf may have more support than is generally realized, says Teresita Schaffer. The influx of Afghan refugees has put more burden on an already poor country. Many Afghans have outworn their welcome.

"There are a lot of Pakistanis who feel that they have really suffered from the backwash from Afghanistan," she said. "The Pakistanis who have gone in to help the Taleban in Afghanistan have come back and made trouble, sparked sectarian violence and have generally been an embarrassment."

But if Afghans begin to suffer too much from the war, Teresita Schaffer says they could regain some sympathy at the expense of the President.

All the more reason, then, for the President to emerge as a winner in cooperating with the United States. To begin with, he expects all the U.S. sanctions on his country to be lifted, says Stephen Cohen. He also wants U.S. help in resolving the Kashmir conflict with India. And he wants to make sure Pakistan has a role in forming a post-Taleban government in Afghanistan.

"He has abandoned the old policy of in a sense making Afghanistan a colony of Pakistan," said Mr. Cohen. "But he is concerned that Pakistan not fall under Iranian or Russian or Indian influence."

Mr. Cohen says President Musharraf has taken a large risk for the United States. He means to be suitably rewarded.