President Mohammed Zia ul-Haq of Pakistan says that the Soviet Union is seriously interested in exploring a political settlement to the six-year-old war in Afghanistan.

"We are in touch with them directly and indirectly, and from all counts, the signals we are receiving are that the Soviet Union wishes to withdraw," Zia said in an interview at his palace here last week.

The Pakistani leader explained Moscow's Afghanistan problem this way: "Inside Afghanistan, if you look at it from the Russian point of view, things are not going so well. I'm sure they can't afford to suffer as many casualties as they are suffering today. So, from that point of view, they also appear to be keen to resolve the issue of Afghanistan. I'm talking from my own personal knowledge, and from the exchange of views directly and indirectly that we have been receiving and conveying to Soviet authorities themselves."

President Zia's hopeful view of Soviet intentions marks a change in his previous hard-line position. Though his tone was cautious during the interview, he seemed to be signaling Washington that he thinks it's time for negotiations over Afghanistan, rather than an escalation of the covert war -- as some U.S. officials are urging.

Many U.S. officials question Zia's optimistic account of the Soviet peace feelers. They argue that the Soviets, far from thinking of withdrawal, are digging in for a long war. And they predict that rather than a negotiated settlement, the most likely prospect in Afghanistan is a protracted military stalemate. One Pentagon analyst describes talk of Soviet withdrawal as "a lot of hogwash. They intend to stay."

Even some Pakistanis are skeptical of Zia's assessment. "Let's be very frank. The Russians didn't come in to withdraw," said Pakistan's assertive new prime minister, Mohammed Khan Junejo, in an interview here last week. He added: "I agree with the people who say the Soviets will not withdraw."

Zia views the Afghanistan conflict in strategic terms. He reached for a well-worn atlas to explain why he believes the Soviets originally invaded Afghanistan. Pointing to Pakistan, he said: "If they move here over the bodies of Pakistanis, they are at the mouth of the Gulf, and whoever controls the Straits of Hormuz controls the Gulf. In one move they have threatened to secure the Straits of Hormuz, encircle Iran and tell the Chinese, 'We are on your flank.' So strategically speaking, this is ideal."

Yet Zia questioned the view held by some American officials that the U.S. should increase its aid to the Afghan resistance fighters, the mujaheddine, to force the Soviets to accept a political settlement.

"To expect that the greater the insurgency, the less the time the Soviets will spend in Afghanistan is wrong," he said. "You've got to find a political solution to the problem. The insurgency is a tactic. It will help find a political solution, but it will not bring about a solution. So, if anybody's thinking that the greater the heat of the insurgency, the easier the solution, he is wrong. The freedom fighters must continue their effort at the present level."

Zia didn't hide his concern that an escalation of Western aid to the resistance could bring attendant dangers for Pakistan. Pakistan now is home for more than 3 million Afghan refugees. Moreover, Pakistan provides a base for the resistance fighters -- and a route for supplies and arms to enter into Afghanistan. Thus far, said Zia, Soviet incursions into Pakistan have been minor. But if further provoked, the Soviets could cause more trouble.

To date, Pakistan's president has played the political game with considerable skill, minimizing the East-West aspects of the Afghan struggle, while enabling the resistance to receive covert aid. The strongest evidence of his success is the most recent United Nations vote on Afghanistan, where 122 out of 159 members voted to condemn the Soviet invasion. He summed up the delicate Pakistani dilemma by saying, "The question is at what temperature does the kettle boil? If it's too high, the lid will fly off."

Zia outlined what kind of political solution would be acceptable to Pakistan. "The Soviet Union must withdraw," he said. "The refugees must return and it would be left to the people of Afghanistan to decide what kind of a government they want. We grant the Soviet Union that a superpower cannot tolerate a hostile neighbor." But Zia noted ironically that Afghanistan was pro-Soviet and hostile to Pakistan long before Soviet troops marched in.

Pakistanis are especially fearful of a two-front war: Afghanistan, a battleground for the last six years, is on one border, and India, Pakistan's traditional enemy, is on the other.

The India problem has eased slightly. Zia regards Rajiv Gandhi as a major improvement over his late mother, Indira. "We have found a great difference," he said. "We have already made good progress, and I hope it continues." But he cautioned that Rajiv isn't likely to alter India's close relations with the Soviet Union. "It's not possible," he said, "If you analyze the Indian position, you will see that their entire military is dependent on the resources of the Soviet Union . . . . Even if the leadership desires to change, it's impossible."

Zia continues to regard the United States as an ally, but he is pragmatic. "One must not expect too much, even from one's wife," he said. "Then you're not disappointed. If Pakistan starts expecting that the U.S. will bring American troops and fight both against India and the Russians, the Pakistanis are expecting too much. If the Pakistanis are expecting that the U.S. will open the gates of Fort Knox and throw all the gold for Pakistan, it's also expecting too much. We should expect from the U.S. only what we think is necessary and essential and then we will not be disappointed."

Zia is now preoccupied with events in his own country where, after nine years, martial law has been lifted and democracy is coming in stages. First, there has been an election of a national assembly, which has begun to function like a parliament. Zia has also appointed the new prime minister, Junejo, spreading executive power slightly while keeping for himself the posts of president and army chief of staff.

Analysts here and in Washington debate whether Zia can control the process of democratization he has begun. Despite widespread speculation that his recent power-sharing moves came under pressure from the U.S. Congress, Zia asserts that he came up with the plan himself. Others are now saying that Zia initially may have thought he could limit the powers of the assembly. Once the process was launched, they say, Zia found he couldn't stop it short of reimposing martial law -- a trump card he still holds.

Today, much day-to-day government business has already shifted to the new prime minister. The fact that Junejo, rather than Zia, attended Swedish Prime Minister Olof Palme's funeral was read here as a sign that he is accumulating more and more power. There are rumors that Zia will step down as army chief of staff by the end of the year, and become a civilian president. He insisted, however, that he isn't yet ready to do this.

Junejo offers a blunt explanation of the division of power between him and Zia. "Power has shifted," he said firmly last week. "Power lies with the chief executive of the country" -- meaning Junejo. Asked how it was decided that he, rather than Zia, should go to the Palme funeral, Junejo explained: "I told him, 'I'm going.'"

Some American analysts worry that Pakistan may be heading toward a period of internal instability. Some skeptics even argue that Pakistan isn't a real country but -- somewhat like Lebanon -- a collection of sects that is united only by its army.

Without the army running things, these skeptics say, the Pashtoon, the people that dominate the Northwest Frontier Province, might be recruited into a separatist movement fueled by the Soviets. The same separatist feelings might also arouse the Baluch and the Sindis, two sects that have felt underrepresented in a nation dominated by the Punjabi.

But Pakistanis optimistic about the democratic process, such as Fakhar Imam, the speaker of the assembly, say that democracy is the only hope for Pakistan -- the only way to defuse the battle that could erupt for the hearts and minds of the Pashtoon.

Many questions remain for Pakistan during its current, bumpy transition to democracy. Power sharing may already have undercut Zia's tough policy toward the Afghanistan war, for example, despite Zia's claims to the contrary. When power lay solely in Zia's hands, it was easier to run a covert war. Now there is a prime minister who must respond to questions, and who must take into account the resentment felt by many Pakistanis at the presence of 3 million Afghan refugees, draining resources from an already impoverished nation.

That's why Zia is scared of what U.S. officials believe is the likeliest outcome in Afghanistan -- a bloody stalemate. His options are limited. He fears that escalating the covert war could bring Soviet bombers over the Pakistani city of Peshawar. He also knows that halting aid to the mujaheddine would leave the Red Army on his border, where it could threaten to dismember Pakistan. He talks hopefully of negotiations, but he's an experienced enough strategist to know that the Soviets aren't likely to withdraw voluntarily except under the most favorable terms.

And that's why Zia speaks of Afghanistan as everyone's problem. "I don't call this a regional problem, I call this a global problem," he said. "Because if you accept in Afghanistan that might is right, that a superpower can walk in and subjugate a country, then we are leaving very little for posterity and the free world will have nothing to offer."