Algerian diplomats, playing a role that one official called "creative mediation," became midwives to the vastly complex negotiation process that finally brought the release of 52 American hostages and billions of dollars in Iranian assets.

To the astonishment of many observers, however, the Algerians appeared to be embarrased by and are shunning the outpouring of gratitude from Tehran and Washington for their help for fear it could compromise their new-found neutral image.

Algeria insisted that it was acting as "nothing but a mailman" for the two sides, but knowledgeable Algerians concede privately that, as one of them put it: "An intermediary is a catalyst; a catalyst is never a passive element."

Algerian officials say they convinced both sides to be more flexible, but they are resisting going into much detail. Foreign Minister Mohammed Benyahia, who oversaw the mediation, has given strict orders to Algerian diplomats who handled the negotiations not to discuss the talks with the press.

Algerian officials attribute the success of the negotiations to their objectivity with both sides and to their absolute discretion about the diplomatic conversations.

Algeria has a great interest in continuing to keep the ins and outs of the negotiation as quiet as possible because the government apparently is preparing to renew its bid to mediate the war between Iran and Iraq.

It seems unlikely, however, that Iraq would accept Algeria's impartiality in the conflict since the Algerians have just helped Iran get rid of the hostage problem as a distraction from the Iranian war effort, and the deal gives Tehran some of the resources needed to carry on its war effort.

The Algerians stress that they did not perform a service for the United States alone. Recalling that they responded to Iran's request that they be the intermediaries, the Algerians say in private that they succeeded in lifting the standing threat of U.S. military intervention against Iran and that this can only serve as protection for the Islamic revolution.

The Algerian official view is that the Islamic government is infinitely preferable to the shah it replaced. One official summed up this attitude by saying, "In Tehran, the Palestinian flag can now fly openly where the Israelis used to walk the streets."

The United States was initially inclined to deal directly with Iran, observers here recalled, but Iran insisted on having Algeria act as the intermediary. The Algerian Embassy in Washington had been representing Iranian interests in Washington since the break of diplomatic relations in April 1979.

For Iran, Algeria met the basic criteria of being Islamic, revolutionary and on confident working terms with Washington.

Algeria had the additional advantage of a well-tested and established negotiating tradition deeply rooted in its historical connection with France, the codifier and inventor of much of modern diplomatic practice. Foreign Minister Benyahia, in charge of the negotiations, has been in the Algerian diplomatic corps for more than 20 years and is a veteran of the negotiating team that concluded the Evian agreements ending Algeria's war for independence from France 21 years ago.

"Why is everyone so astonished by the quality of the Algerian negotiators?" asked an experienced French diplomat here. "They have a high level of competence, as high as the Quai d'Orsay [the French Foreign Ministry]."

The U.S. State Department is reliably understood to have asked the Algerian government to make representations to the Iranian government about the hostages soon after their captivity began in November 1979. But the Algerians refused, saying the time was not ripe since the power structure in Tehran was too confused for such moves to be effective.

On Nov. 3, almost one year to the day after the hostage-taking, Tehran signaled its readiness to negotiate seriously by formally designating Algiers as the intermediary.

Algerians freely admit that their success in the Iranian-American deal was partly a matter of timing. The implication is that they may have recognized that Iran was more open to compromise because it needed weapons, money and the opportunity to break out of its diplomatic isolation over the hostage-taking.

The U.S. concessions in the bargain are already the subject of public debate in the United States. But observers also note that Iran made a series of important concessions that Algeria apparently played an important part in obtaining.

The Algerians are adamant that they had no ulterior motives in accepting the middleman role and that they in fact took the risk of being blamed for a potential failure. But, Algerian officials say, if there are now to be advantages, there is no reason to turn them down.

"If Algerian-American relations are going to improve, so much the better," said the Algerian Foreign Ministry spokesman.

U.S. Ambassador Ulrich Haynes said, "The American government and people have contracted a longstanding debt to Algeria. I don't know how we'll ever pay it off."

Close observers of the Algerian scene agree that the payoff Algeria really expects is not a material one like a better price for the huge quantities of liquified natural gas whose sale has been under dispute between Washington and Algiers. The climate surrounding the dispute will undoubtedly be improved, however, by the likelihood that the image of Algerian reliability generally and therefore as an energy supplier has been enhanced.

The greatest benefit has probably already been realized -- the reinforcement of Algeria's claim both to recognition as a genuinely nonaligned country, despite its heavy dependence on the Soviet Union for advanced weaponry, and to a leadership position in the nonaligned movement.

But a more direct benefit, diplomatic analysts have concluded, is the right to try to hold the United States to its word when Washington claims to be neutral between Algeria and Morocco in the desert guerrilla war waged from Algerian soil by tribesmen seeking to establish an independent Western Saharan republic in the former Spanish Sahara largely occupied by Morocco.

Algeria contests the U.S. claim to neutrality if only because Washington continues to arm Morocco with arms appropriate for desert warfare. Outgoing Ambassador Haynes said in an interview with the French news agency Agence France-Presse after the Algiers agreement that "I found that it was difficult for me to defend my country's claims to neutrality, given the arms sales to Morocco."