ISLAMABAD, PAKISTAN -- Saudi Arabia is sending home an estimated 10,000 elite Pakistani troops who have provided a little known but significant element of the desert kingdom's defense force for much of this decade.

The move underlines the two Sunni Moslem-dominated countries' sensitivities to their Shiite neighbor, Iran, and to Iran's influence on the Shiite Moslem minority populations in both countries. It is another sign of the confusion in the Moslem world caused by Iran's radicalism.

Since the early 1980s, Pakistan has kept an elite tank brigade stationed in Saudi Arabia at the kingdom's request to help defend against outside attack, ostensibly from Israel. There is an unspoken assumption that the highly mobile tank brigade was also intended to provide an extra measure of security for the Saudi royal family, serving as a praetorian guard.

But the contract arrangement, which provided diplomatic and economic benefits to Pakistan, has been dissolving in the past year and a half.

According to Pakistanis and diplomats interviewed here, the trouble over the troops arose when it became clear that they might become embroiled in the tensions between Iran and Saudi Arabia growing out of the Iran-Iraq war. The Saudis are strong backers of Iraq.

One informed official said Saudi Arabia even indicated that it wanted to use the Pakistani troops to confront Iranian forces directly.

But Pakistan, with a long border with Iran and a 15-percent Shiite population, sees grave dangers in confronting its neighbor.

Saudi Arabia also has become more wary of Shiite influence in its own country, notably after the July 31 violence involving Iranian Shiites during the annual hajj, or pilgrimage, to Mecca, Saudi Arabia.

Pakistan's role in defending Saudi Arabia is a highly sensitive topic, upon which Pakistani military experts and foreign diplomats here are reluctant to comment and refuse to be quoted by name. One Pakistani official familiar with the issue played down the Saudi decision not to renew the agreement, which ends next month, that has kept the Pakistanis in Saudi Arabia.

"It was a contract for a fixed period and now it is over. The Saudis are raising their own troops," he said.

Other knowledgeable Pakistanis and diplomats say the situation is much more complex and that the heightened tensions in the Persian Gulf region, fueled by the seven-year-old Iran-Iraq war, are forcing basic Saudi and Pakistani interests into conflict after years of congruence.

The troop issue is first believed to have surfaced about a year or 18 months ago, according to well-informed sources. The Saudis reportedly became sensitive that about 10 percent of the Pakistani troops were Shiites and asked Islamabad to replace them with Sunnis, something Pakistan said it would not do since the Shiites were an integral part of the Pakistani Army.

These sources say there have been reports that Saudi Arabia told Pakistan it wanted to use the Pakistani troops as a frontline force to help Saudi Arabia's ally, Iraq, or to confront Iranian forces should the war spill over to Saudi Arabia or its neighbor, Kuwait.

One knowledgeable source said the Saudis "came to us about a year and a half ago and wanted to put our forces into the front line.

"We said no, that is not what they are there for. We said, 'You have them on contract for defense, and if you need them for that purpose, that is why they are there. But they are not there for offensive purposes.' "

"The mood in Pakistan is unlikely to allow their troops to fight any Moslems," said one western expert. "Alternatively, the Saudis would be expected to say, 'What's the point of having Pakistanis here if we can't use them?'

"When the time came for renewal, Pakistan said we won't fight against Iranians. We are here to fight Israelis," the western expert said. "The Saudis said we are not likely to have to fight Israelis very soon, but" Iran is a different matter.

Pakistan traditionally has tried to maintain close relations with Shiite-dominated Iran while also building diplomatic and military bridges to the Arab world. In addition to Saudi Arabia, Pakistani trainers, advisers, technical experts or troops are posted in Oman, the United Arab Emirates, Kuwait and Jordan.

"The Pakistanis are the Prussians of the Moslem world," said one observer, a status that has given them a significant flow of hard currency and diplomatic influence in the Arab world. It is a status Islamabad's diplomats have exploited successfully in their dealings with major western nations, including the United States.

But a potential Iranian threat to Pakistan has been made clear recently. This summer, Iranian commandos attacked exiled Iranian dissidents in the Pakistani cities of Karachi and Quetta.

More important, Pakistan's Shiites have been organizing politically in recent months and have emerged as a force in the already tumultuous Pakistani political scene.

Iran makes little effort to hide its willingness to support Shiites elsewhere in the Moslem world, and at a recent diplomatic reception, the Iranian ambassador in Islamabad is said to have boasted openly that he could "bring a million Shiites into the streets of Pakistan in an hour."

Officials here are unclear about what the Saudis intend to do to replace the Pakistani troops, most of whom are stationed at Tabuk, site of a major base in northern Saudi Arabia. Pakistanis and diplomats said there were reports that Riyadh had approached Bangladesh about replacing the Pakistanis, but Dhaka's forces were found to be unsuited for handling the sophisticated tanks and other equipment that the Pakistanis have been manning. There also are believed to have been contacts with Morocco on the same subject, these sources said.

The Pakistani troops first went to Saudi Arabia in the early 1980s, after the Iranian revolution was well established and after it had become clear that the gulf war was not going to be won easily by Iraq, as many had anticipated when it first broke out.

In addition to the political importance of the relationship, Pakistan also has gained valuable hard currency and training opportunities for its troops, not to mention the morale boost for soldiers earning as much as four times their normal salaries while serving in Saudi Arabia. Returning Pakistani troops often bring back appliances and electronic goods that raise their family's status. The added income allows them to buy houses and businesses. Troops are rotated for the Saudi assignments, not only for operational reasons, but also to spread this largesse.

One observer said Pakistan would have little trouble using the tank brigade at home since there were a number of "thin spots" on the frontier with India. The brigade was using Saudi equipment, however, so it will have to be equipped from Pakistan's own stocks. Diplomatic sources said China is to send Pakistan at least 100 new tanks soon.

Special correspondent Kamran Khan contributed to this report from Karachi, Pakistan.