Vietnam has turned a tactical retreat on the issue of refugees into a major propaganda victory, in the opinion of U.S. diplomats at the U.N. conference on Indochinese refugees that ended Saturday night.

"It was brilliant," said a senior U.S. official. "They got everyone to thank them for ending a crisis that they caused in the first place."

He noted that the Vietnamese even managed to get the implicit endorsement of U.N. Secretary General Kurt Waldheim by maneuvering him into giving maximum impact to their decision to halt the flow of the boat people.

The Vietnamese repeatedly had told reporters before the conference ended that the French idea of a moratorium on refugee departures merely was worthy of study.

But at the close of the conference, Waldheim dramatically announced. "The government of the Socialist Republic of Vietnam has authorized me to inform you that, for a reasonable period of time, it will make every effort to stop illegal departures."

The Vietnamese do not hide their desire to continue to get rid of large numbers of people. U.S. analysts say they believe Hanoi backtracked because it realized it was losing most of its support among people and countries that strongly had backed it against the United States during the Vietnam War.

The moral capital that Hanoi had amassed in the world was threatening to go down along with the unseaworthy boats breaking up in the South China Sea.

In the United States, war resisters, such as Joan Baez, had turned against Vietnam. Sweden and Yugoslavia, formerly Vietnam's strongest independent supporters in Europe, were making their disaffection increasingly clear.

The European Common Market diverted all its aid for Vietnam to helping the boat people. A large proportion of the reflexively anti-American, French leftist intellectuals publicly were beating their breasts about having been mistaken to support Indochina's Communists.

The Vietnamese attending the conference gave no outward indication of being disturbed. Vietnamese delegation chief Phan Hien said in response to Vice President Walter Mondale's strictures that the Americans "have no lessons to give us."

Phan said people were fleeing Vietnam simply because they had been subjected to a "formidable" propaganda campaign, presumably Chinese and American.

Some staffers of the U.N. High Commissioner for Refugees went even beyond the American view that Waldheim was cleverly manipulated by the Vietnamese. They expressed outrage that Waldheim should present as a political victory what is likely to be the creation of a giant prison to "protect" Vietnam's own people from the hazards of escape.

Top-level Americans did not go that far. They expressed some confidence that the Vietnamese, having already made a major tactical confession under the pressure of international opinion, would not risk sacrificing their propaganda victory by once again offending their own supporters with the spectacle of Vietnamese gunboats sinking refugees' rafts.

Yet, Phan Hien spoke menacingly of his country's laws allowing "severe punishment of illegal departures."

The Vietnamese admission, in effect, that they can control the exodus, has an obvious counterpart. If the Vietnamese do what the French and others have asked them to do by accepting a mortatorium on "illegal" departures, and Westerner who complains about how that moratorium is enforced seems bound to be confronted with a Vietnamese response that amounts to: "Make up your mind what it is you really want."

The American answer at this point seems to be to walk a relatively fine line between continuing to condemn Vietnamese policies while trying to enlist Vietnamese support for the organization of an orderly flow of refugees.

The Americans claim credit for getting China to tone down its insults toward Vietnam in Geneva and for getting the British to accept the notion that the Geneva conference, originally British Prime Minister Margaret Thatcher's idea, should be more than an opportunity for everyone to feel better by taking a few good pokes at Hanoi.

On the one hand, the Americans say they have informed Hanoi this week that they are willing to send U.S. consular officers to Ho Chi Minh City to speed up and regularize U.S. immigration procedures for would-be refugees.

On the other hand, the Americans say they will support any call, especially from U.S. friends in Southeast Asia, to rake Vietnam over the moral coals at the U.N. Security Council.

From the U.S. viewpoint, a Security Council session would be useful to rub some of the shine off the Vietnamese public-relations victory in Geneva.

The Americans also want a Security Council debate because the situation of the refugees from Cambodia and Laos did not really get much of an airing at Geneva.

The Americans seemed happy to let the French in particular have all the credit they clearly seemed to want for the two key ideas that spelled the success of the conference - the moratorium on refugee departures and the establishment of processing centers inside Vietnam.

The Southeast Asian countries with overcrowded refugee camps were visibly relieved that the pressure of the exodus would be reduced. The Americans kept publicly hailing the "compassion" of receiving countries such as Malaysia that, in reality, had been pushing refugee boats back into the sea.

Those who raised questions about whether Vietnam would be turned into a giant Gulag were not very popular with most of the diplomats at Geneva. Some cynics suggested that the international conscience would be eased even if the dying in Vietnam continued, because it would be comfortably out of sight of diplomats and international bureaucrats.