To obtain the release of three French hostages held in Lebanon, France agreed to resume diplomatic relations with Iran, settle a dispute over loans, lift an oil embargo and free two jailed extremists, sources close to French and Iranian negotiators said here Saturday.

The release Wednesday in Beirut of journalist Jean-Paul Kauffmann and diplomats Marcel Carton and Marcel Fontaine - four days ahead of the final round of French presidential elections - followed protracted negotiations between France and Iran in Switzerland, Austria and Turkey, sources said.French Prime Minister Jacques Chirac has denied that any ransom was paid or that any direct negotiations took place with the hostage-takers.

The deal was twofold. Part of it has already been made public; the rest will follow over the next few weeks, sources added.

Chirac, who is running against President Francois Mitterrand in Sunday's poll, has already publicly thanked Iran for its help in securing the release of the hostages, held for more than three years by pro-Iranian fundamentalists in Lebanon.

He has also announced that the release opens the way for a resumption of diplomatic ties between Paris and Tehran.

The second part of the deal involves the settlement of a dispute over the repayment of a $2 billion loan granted to France by the late Shah of Iran in 1974 to fund the international nuclear EURODIF consortium.

France has reportedly also agreed to allow "unrestricted" exports of EURODIF-produced uranium to Tehran.

Paris is also to lift its embargo on the import of oil from Iran, imposed in August following the break in diplomatic relations.

Until last summer, Iran was the biggest supplier of crude oil to France.

Tehran has also expressed the hope that France, along with Japan, will resume its financial investments in Iranian industrial projects.

Finally, two Moslem extremists held in France could also be freed as part of the deal, sources suggested.

Lebanese Anis Naccache, sentenced to life imprisonment for attempting to murder exiled former Iranian Prime Minister Shapour Bakhtiar, and Tunisian Fouad Ali Saleh, who faces charges in connection with the 1986 Paris bombings which left 13 dead and more than 250 injured, could be released.

Only the French president can grant a pardon in the case of a life sentence. Presidential pardons are often granted in the wake of a presidential election.

Sources however confirmed government claims that no ransom had been paid to the hostage-takers despite their demand for $25 million.

The agreement left it up to Iran to deal with the hostage-takers, as Paris did not wish to be involved, sources added.

Sources also confirmed that there were no direct negotiations between France and the hostage-takers but that talks took place in Beirut and the Syrian-controlled Bekaa Valley with "bona fide representatives" of Moslem fundamentalist factions.

No details were available on possible arm sales by France to Iran through intermediaries.