PARIS, DEC. 7 -- The French government rounded up dozens of Iranian dissidents and ordered them expelled today in what the exiles said was "ransom" for the recent liberation of two French hostages in Beirut.

The expulsion order, announced by the Interior Ministry, appeared to be the latest step in a complicated secret agreement worked out with Ayatollah Ruhollah Khomeini's government by Prime Minister Jacques Chirac and his aides to win the hostages' release.

The accord, only parts of which have become known, led to the freeing Nov. 27 of the two French journalists and the trade two days later of an Iranian official confined in Paris for a French diplomat confined in Tehran. With this exchange and France's promise of quick payment on a billion-dollar debt to Iran, French officials have expressed hope that the remaining three French hostages in Lebanon will soon be freed and relations with Iran will be normalized.

The expulsion order announced today affected supporters of the People's Mujaheddin, an Iraqi-supported rebel group headed by Massoud Rajavi. The Baghdad-based organization, whose military action has been coordinated with Iraqi efforts in the Persian Gulf war, represents the major armed resistance by Iranians to Khomeini's rule.

Mujaheddin officials in Washington said their guerrillas have killed or wounded 8,400 Iranian soldiers and taken 845 prisoners in about 100 clashes along the Iran-Iraq border since the beginning of the year.

The Interior Ministry said "several dozen" Mujaheddin militants were detained early this morning around Paris and served with expulsion orders because "they were carrying out within that organization militant acts that gravely harm public order." Those rounded up were placed in "administrative retention," the ministry said, apparently meaning they were being kept in police custody pending expulsion.

The ministry's communique did not describe the militant acts on which the expulsion orders were based. Mujaheddin spokesmen here and in Washington said their supporters have violated no French laws and have been residing in France under political asylum as defined by U.N. and French statutes.

"There is no doubt that these expulsions are part of the ransom Khomeini is seeking from the French government and that the French government has given in to this little Hitler, that is, Khomeini," said Shahin Gobadi, a Mujaheddin spokesman, in a telephone interview from Washington.

The French deputy interior minister for security, Robert Pandraud, told reporters the expulsions were not part of a "bargain." He said they were ordered under French policy that accords asylum only as long as "political refugees do not foment outside attacks from French territory and do not by their presence or declarations compromise French diplomatic interests."

The French granted Khomeini asylum during the last four months of his campaign to overthrow the regime of Shah Mohammad Reza Pahlavi, a point noted by Rajavi, the Mujaheddin leader, in a telegram of protest to President Francois Mitterrand.

The Interior Ministry did not say when the expulsions would be carried out or where the Iranians will be sent. News reports quoted French officials as saying those expelled would not be forced to return to Iran. But it was unclear what other country besides Iraq would be willing to accept them.

Rajavi himself was based near Paris from 1981 until June 1986, when he was expelled as part of Chirac's first attempt to improve relations with Tehran. Two French hostages were released within 15 days.

The Iranian government has long maintained it has influence over, but does not control, the Shiite extremist groups in Lebanon that hold western hostages, including eight Americans. French officials have maintained, however, that they dealt only with the Iranian government in freeing the two hostages.

At the same time, a number of reports here have described secret French contacts with the Lebanese abductors, and some reports -- denied by the government -- said the French government also made a direct payment to them.

Interior Minister Charles Pasqua, widely credited with engineering the deal with Iran, reacted strongly to some of these reports in the U.S. press. In a clear allusion to the Reagan administration's Iran-contra scandal, he said, "We have no lessons to receive from those who sold arms {to Iran} and who possibly were ready to pay ransom."

The Reagan administration sharply criticized France last week for agreeing to pay $330 million dollars on its debt to Iran as part of the apparent hostage deal.

Since his expulsion, Rajavi has worked in Iraq, Iran's foe in the bloody war and the Mujaheddin's chief foreign backer. But after French ties with Iran soured and the two countries severed diplomatic contacts last summer, Iranian opposition sources said, a number of Rajavi's supporters were quietly allowed to resume activities in France.

Mujaheddin spokesmen said French police beat and insulted the militants in today's roundup.