MOSCOW, NOV. 26 -- Soviet President Mikhail Gorbachev warned today that if Iraq does not withdraw from Kuwait and release all foreign hostages it will face the consequences of a "tough resolution" in the United Nations.

The Soviet news agency Tass said Gorbachev told Iraqi Foreign Minister Tariq Aziz that Baghdad must begin taking concrete steps to show that it wants to avoid war in the Persian Gulf.

According to Tass, Gorbachev told Aziz: "If Iraq really wants a settlement in the entire region and is trying to avoid the worst, it must now openly declare and show in its actions that it is leaving Kuwait, freeing hostages and, in general, is not preventing anyone from leaving Kuwait. Otherwise, the U.N. resolution will be adopted -- a tough resolution."

The statement referred to a resolution being prepared by U.N. Security Council members, led by the United States, that would lay the political foundations for the potential use of military force against Iraq. A draft resolution circulating in New York declares that the United Nations is prepared to use "all means necessary" to enforce its earlier demands for an Iraqi pullout from Kuwait if there is no withdrawal by the end of the year.

Soviet Foreign Minister Eduard Shevardnadze, after meeting with his Saudi Arabian counterpart here Tuesday, is scheduled to leave Wednesday for New York for a meeting of the Security Council. Gorbachev and Shevardnadze have signaled that they have grown so frustrated with Iraq that they are prepared to vote for the resolution despite earlier hesitation.

In a session of the Soviet legislature today, Gorbachev said that the Soviet Union must continue to cooperate with the rest of the world to show Iraqi President Saddam Hussein "that there is no hope that he can break international unity. We should prove to ourselves and to all nations that we can solve the most acute conflicts by political means characteristic of this new era."

During his meeting with Aziz, Gorbachev seemed especially angry about Saddam's tactic of detaining foreigners. The Soviet leader said "it is against the norms of ethics that people are being let out in groups of several dozen in some kind of trading."

About 3,315 Soviet citizens, most of them technicians and their families, reportedly are still in Iraq. Last month, Saddam promised a Soviet envoy that the Soviet citizens could all return home. More than 1,000 were scheduled to return this month, but Iraqi officials allowed only 350 to go, according to Foreign Ministry spokesman Vitali Churkin.

"This is completely abnormal, and we cannot accept it," Churkin told reporters. "If the Iraqi side does not immediately remove all obstacles and let our citizens leave, this will complicate the situation further, and we will be forced to adopt a tougher attitude."

Tass said that Aziz "used the same old arguments" to justify the Iraqi invasion and maintained that only "bureaucratic" problems were holding up the release of Soviet citizens.

The Soviet Union has joined in an unprecedented international united front against the Iraqi invasion, but Gorbachev has shown greater reluctance than the U.S. side to shift to a military solution in the Persian Gulf. At a press conference here Friday, he said there was "absolutely" no division between him and the West on the issue, but he warned at the same time that a military conflict in the region was potentially more dangerous than two infamous conflicts of the last 25 years.

"This is not Vietnam; this is not Afghanistan. This is extremely serious," Gorbachev said.

Tass said Shevardnadze told Aziz the Soviet Union would insist that Baghdad abide by previous U.N. resolutions calling for withdrawal from Iraq, adding that Moscow would not be persuaded by arguments that Kuwait is historically a part of Iraqi territory.

Churkin said Moscow felt "frustration" at its inability to get its citizens out of Iraq more quickly. In one instance, Churkin said, an Aeroflot flight from Bagdhad to Moscow had to be canceled because the Iraqis failed to give the passengers proper exit visas.

When Iraq invaded Kuwait Aug. 2, about 8,000 Soviets were in Iraq, including several hundred military advisers. More than half have been able to leave, particularly women and children, but many of the advisers remain.

Churkin said he had no reports that Soviet citizens are being detained at military installations as "human shields." He added, "All our nationals are where they were before the crisis began."