Foreign Minister Sadegh Ghotbzadeth threatened today that Iran would halt all oil traffic out of the Persian Gulf, where nearly two-thirds of the West's oil imports are produced, if the United States mines Iran's ports in the Gulf.

Ghotbzadeh did not say how Iran, whose military forces are believed to have deteriorated in the last year, would do this.But he indicated that Iran would ask the Soviet Union for help at least in defusing any mines that might be placed.

The Iranian foreign minister, speaking at a news conference, also criticized the European Common Market countries for adopting sanctions this week aimed at pressuring Iran to free the Americans held hostage here since Nov. 4.

Western Europe's decision, he said, showed that "European countries are captives of American foreign policy."

Asked what Iran would do if the United States mined Iranian ports, Ghotbzadeh said the government would "probably" request foregin help in removing mines from the harbor and hinted that the Soviet Union could be the source of such aid.

"If the whole West wills that a country like Iran be totally dependent on the East because of the question of the hostages, we are not going to certainly starve to death," Ghotbzadeh said.

But he was careful to stress Iranian reluctance to be pushed closer to the Soviet Bloc. "With the last drop of blood, we are not going to be dependent either on the West or on the East," he said.

Ghotbzadeh said than if the harbors were mined it would give Iran the choice "of not letting any other country supply oil, even if the whole area goes to fire . . . If they [Western countries] continue these kinds of pressures, let no one get anything from the Perisan Gulf.

"It's not going to be only Iranian oil which is gong to be cut off. The whole oil of the Persian Gulf will be cut off from everywhere. We have our honor as well. We are not going to sit with our hands tied and let the United States or the European countries do whatever they want," he added.

The foreign minister did not mention any potential Iranian use of military force to try to back up this warning.

Diplomatic analysts said that Iran could wreak havoc in international oil trade by sinking an oil tanker in the Persian Gulf, or by threatening to do so, because this would drive tanker insurance rates sharply upward.

Iran is capable of taking such military action, analysts said, but they cautioned that this would probably incur the wrath of Arab countries along the Gulf and provide neighboring Iraq with an excuse for carrying out an implied threat to take back from Iran three strategically located islands in the Strait of Hormuz that Iran occupied in 1971.

The analysts also said it would be difficult for Iran to block the strait with its Navy because it is 28 miles wide at the narrowest point. Nor would sinking a supertanker choke off the flow of oil from the Gulf because the waterway is more than 600 feet at the shallowest point.

Ghotbzadeh said he thought the hostage crisis would continue "unless the Americans and the European countries recognized Iran's legitimate rights."

He said it was unrealistic to think that the captives would be released by May 17, the date set by European Common Market countries for the start of the second stage of their sanctions.

Ghotbzadeh said he hoped that after Iran's new parliament convenes, Iran and the United States could "rapidly come to a resolution of the problem." The parliament, which has yet to be finally elected, is expected to meet in May, or possibly June.

Asked if more families of hostages would be allowed to visit their relatives at the occupied U.S. Embassy, Ghotbzadeh said that they "most probably" could, but he expressed puzzlement as to why Washington opposes such visits.

Meanwhile, the parents of the youngest hostage, Marine Sgt. Kevin Hermening, continued their efforts to obtain his release following a reunion Monday between him and his mother, Barbara Timm.

In separate remarks today, President Abol Hassan Bani-Sadr called on Moslem fundamentalists not to attack opposition political groups in an apparent attempt to curb the widespread disturbrances that have followed a government-sponsored crackdown on leftists at Iran's universities.

Appealing for "disciplin and security," Bani-Sadr appeared to back away from the aggressive stance the government adopted this week in launching a campaign to purge Iranian campuses of leftist elements.