Iranian Foreign Minister Sadegh Ghotbzadeh yesterday denounced the Soviet Union's occupation of Afghanistan, pledging to do "everything possible" to force a retreat including the possible support of Afghan rebels.

In an interview with the Paris daily, Le Figaro, Ghotbzadeh said, "We are very worried and very alarmed over the presence of Soviet tanks some kilometers from our border with Afghanistan . . . . We are going to do everything to compel the Soviets to withdraw."

When asked what that entailed, Ghotbzadeh said that if the Soviet Union "continues its aggression" the government is considering the possibility of helping 50,000 Afghan refugees in Iran continue guerilla warfare against the Soviets. Moscow's troops have been in Afghanistan in force since a Soviet-led coup Dec. 27.

The foreign minister's comments came in an interview with one of the few Western news organizations left in Tehran following the expulsion of American journalists earlier in the week.

Although it was believed to have been directed at the West, the interview also raised the prospect that the Iranian government is becoming more concerned about the Soviet threat and may temper the anti-American language that has inflamed the country since the seizure of the U.S. Embassy on Nov. 4.

Iranian officials maintained earlier this week that if attention could be diverted from the plight of the Americans being held in the embassy, a peaceful solution would be easier to find.

But Ghotbzadeh, as well as the militants holding the hostages, reiterated yesterday that the Americans would not be released until the shah and his fortune are returned to Iran.

"We want the shah and his wealth," Chotbzadeh told Le Figaro. "The United States wants their hostages. It's easy. They give us the shah, and that's good. We give them the hostages."

The ousted shah, Mohammad Reza Pahlavi, has lived in Panama since Dec. 15, when he left the United States after medical treatment.

A representative of the militants, in an interview with Agence France-Presse yesterday, also said the Americans would be held until "the shah sets foot in Tehran and his possessions are returned to Iran."

He ruled out any separate release of the hostages. He said that although some had been classed as "less compromised," all the American 'were part of the system and contributed to the spying" in some way.

Meanwhile, revolutionary authorities in the northwestern city of Tabriz arrested 25 Air Force personnel on charges of plotting a coup, the director of the Tabriz jail said.

He said they were arrested for providing arms during recent riots to the backers of Ayatollah Kazem Shariatmadari, a religious rival of Islamic leader Ayatollah Ruhollah Khomeini. No details were given of the attempted coup.

The fighting earlier this month in the Azerbaijani capital left at least 10 people dead and more than 100 wounded and also weakened Khomeini's attempt to assert control over the country's vocal ethnic minorities.

The militants holding the hostages said the United States is trying to take advantage of the uprisings among the minorities to disrupt the upcoming presidential elections.

"The enemies of Islam -- especially the number one enemy, the great Satan, the bloodsucking America -- are seeking to generate plots and confusion in outlying areas to prevent Iran from taking a step toward setting up an Islamic republic," said a statement from the militants' broadcast on Tehran radio. It encouraged "all communities" to refrain from violence in the election Friday.

Yesterday a candidate who supported regional autonomy was disqualified by Khomeini because he was an opponent of the new Islamic constitution. The elimination of Massoud Rajavi, nominee of the radical Mujahedin guerrilla group, opened the threat of a boycott in Iran's ethnic border regions.

Among the front-runners for the presidency are Ghotbzadeh and Finance Minister Abol Hassan Bani-Sadr. Bani-Sadr indicated Iranian concern about the situation in Afghanistan earlier in the week, when he claimed the Soviets are seeking to annex part of Iran in an effort to secure a warm water port in the Arabian Sea.

But yesterday, Bani-Sadr rejected any thought of an alliance with the United States to repel the Soviets.

"My definition of independence is to be independent of both superpowers at the same time," he told Reuter news agency. "If we join one against the other, it would weaken our front against those superpowers and their policy of domination. We need a united front of all oppressed peoples against the superpowers."

Earlier in the week it was reported that part of the estimated 85,000 to 100,000 Soviet troops in Afghanistan were massing along the Iranian border. But U.S. officials said Friday they have no evidence that the Soviets are planning a thrust into Iran.

The Soviets have insisted that their contingents in Afghanistan are there at Kabul's request to help quell insurrections caused by outside influences, including the United States and China, and will be removed as soon as they are no longer needed.