AMMAN, JORDAN, OCT. 12 -- In a frontal challenge to a former ally, Iraq warned today that Soviet military advisers and technicians could be prevented from going home if Soviet authorities pass Iraqi military secrets to the United States.

The threat, attributed to a military spokesman by the official Iraqi News Agency, was couched in terms indicating that President Saddam Hussein's government fears Soviet leaders plan to share specific military intelligence about Iraq with Defense Secretary Richard B. Cheney when he visits Moscow next week.

"We warn them against such behavior if it happens," the military spokesman said. "If the Soviet Union gave the United States the information it was seeking, we would be forced, unfortunately, to act in a way that protects our national security. Among those measures could be ordering the responsible officials to halt the departure of Soviet nationals."

About 5,000 Soviet nationals remain in Iraq, most of them oil workers, according to the Soviet government newspaper Izvestia. As of last Monday, the paper said, the total included 93 military advisers out of more than 200 who served in Iraq before the Persian Gulf crisis.

Izvestia this week quoted Soviet Deputy Prime Minister Igor Belousov as saying that 1,800 Soviet citizens had expressed a desire to return home early and that Iraqi authorities had agreed to allow 1,500 Soviets to leave the country in the next month. About 2,500 Soviet citizens, including most women and children, have left the country since the invasion of Kuwait Aug. 2.

In a telephone interview today, Soviet Foreign Ministry spokesman Gennadi Gerasimov accused the Iraqi authorities of failing to live up to promises to allow Soviet citizens to leave the country freely, Washington Post correspondent Michael Dobbs reported from Moscow. Gerasimov also dismissed recent reports that Iraq may be signaling a readiness to withdraw from Kuwait, saying that they appeared to be based on "nuances."

"When {Iraqi Foreign Minister Tariq} Aziz was in Moscow, he said publicly there would be no obstacles to Soviet citizens leaving Iraq," Gerasimov said. "On the spot, however, they are delaying visas."

A senior Soviet envoy, Yevgeny Primakov, met with Saddam in Baghdad last week in what Soviet officials said was a mission combining peacemaking with efforts to secure release of Soviet nationals who want to leave. Izvestia said 128 Soviets flew to Moscow on Monday as a result of Primakov's entreaties but that problems remained for the majority working as technicians in Iraqi oil fields.

Western officials have said the Soviet Union probably has a vast store of vital information about the Iraqi military and its weapons because Soviet advisers have been involved in the Iraqi military establishment at most levels over the years. Moscow, which signed a friendship and defense treaty with Baghdad in 1972, long has been the chief supplier of Iraqi arms, ranging from assault rifles to air-defense missiles.

The Iraqi statement acknowledged that, as a result, Soviet advisers have had access to "serious secrets" on Iraqi military capabilities and equipment. The spokesman gave no details, but inside information on Soviet-supplied air defense radar and ground-to-air missiles would be useful to the U.S. military in any air strike.

Soviet military officials already have provided some information about the types of weapons they sold the Iraqis, according to U.S. officials.

France, until recently Iraq's second-largest arms supplier, also has shared some information on high-technology French radar, missiles and aircraft sold to Iraq, according to earlier reports in Paris. Cheney also plans a stop in the French capital during next week's trip.

In the new atmosphere of U.S.-Soviet cooperation, President Mikhail Gorbachev ordered Soviet arms supplies halted after the Iraqi invasion.

The Soviet government, although refusing to join the U.S.-led military buildup in the Persian Gulf, also has supported U.N. Security Council resolutions demanding Iraqi withdrawal from Kuwait and imposing an economic embargo to force Baghdad to comply. Foreign Minister Eduard Shevardnadze said recently that Moscow might eventually contribute militarily if the United Nations sponsors a force.

KGB chairman Vladimir Kryuchkov, in the same spirit, told visiting Associated Press executives Sept. 19 that the Soviet intelligence agency was willing to share information about Iraq with the United States.

The Soviet government also has indicated it plans to withdraw its military advisers. But it has resisted suggestions that they all be withdrawn immediately, and Iraq's threat today raised questions about whether they will be permitted to leave.

Similarly, Moscow has taken care to emphasize continuing friendship with Iraq, and Soviet policy has stressed that everything must be done to avoid military conflict as a solution to the gulf crisis.

Primakov's mission to Baghdad, for example, was designed to complement Arab mediation efforts that have centered on compromise suggestions under which Iraq would withdraw from Kuwait in return for concessions on its territorial and financial dispute with Kuwait, according to the Soviet ambassador to Jordan, Yuri Griadounov.

However, Soviet officials briefing U.S. diplomats about Primakov's visit have said that while Saddam appeared to be looking for a way out of the impasse, he was not prepared to accede to U.N. resolutions demanding the withdrawal of Iraqi troops from Kuwait and indicated that he would rather go down fighting.

"It's nice to know he's getting rattled, but he hasn't moved yet," a U.S. official said of the Soviet briefing.

Briefing foreign diplomats in Moscow on Primakov's meetings in Baghdad, Soviet officials said that the Iraqis adopted a more conciliatory tone in talking about Kuwait, Dobbs reported. Aziz in particular was reported to have dropped his previously strong language about Iraq's historical claims to Kuwait, implying that the territorial dispute could be the subject of negotiation.

The change in Iraqi rhetoric appears to have been the principal reason for the relatively upbeat note struck by Soviet spokesmen during the past few days in discussing the crisis. After returning to Moscow from Baghdad, Primakov said that he was somewhat more optimistic than previously about the chances for a political solution in the region.

Most Western and Arab diplomats in Moscow, however, do not think that there has been any significant breakthrough. Gerasimov described the Iraqi position on Kuwait as essentially unchanged, saying that reports of movement appeared to be based on "hairsplitting."

The plight of Soviet citizens in Iraq has become an extremely sensitive issue in Moscow, with many commentators adopting a stridently anti-Iraqi tone. One newspaper, Argumenti y Fakti, recently published a letter from a group of Soviet experts in Iraq asking to be repatriated as soon as possible.

Staff writer R. Jeffrey Smith in Washington contributed to this article.