Beneath the gold-tinted dome of the Hungarian Parliament building, U.S. Secretary of State Cyrus R. Vance today formally returned the sacred crown of St. Stephen to the Hungarian people 32 years after it fell into the hands of the American army in the closing months of World War II.

The return of the crown - a controversial act opposed by some Hungarian-Americans who view it as bestowing legitimacy on an imposed Communist government here - was greeted by official expressions of "high appreciation" for President Carter by Antal Apro, president of the national Assembly.

Apro spoke of the considerable improvement in U.S.-Hungarian relations in recent years and of Budapest's readiness to improve relations. He said prospects of that "are considerably improved by the events of this day."

In an apparent attempt to soothe feelings across the Atlantic, Apro said the Hungarian people "address with esteem, those hundreds of thousands of Hungarian-Americans who had been compelled by the vicissitudes of history to take to the road and who have become citizens of the United States but have always preserved respect and attachment towards their ancient homeland."

The ceremony was attended by about 500 specially invited guests. The government did not announce that the ceremony would take place until a few hours before. There was no public celebration. Outside, in the Parliament building parking lot, about a thousand people milled about.

The crown lay on a red velvet cushion surrounded by other relics of St. Stephen's coronation - an orb, scepter and a robe - that have also been stored at Ft. Knox, Ky., for three decades. They had been placed at the feet of a statue of Arpad, the legendary founder of Hungary. The hall was encircled by the statues of 15 other Hungarian heroes, including one of St. Stephen.

For many Hungarians here - Communist and non-Communist - the return of the crown has removed a lingering thorn in relations with the United States.

"An old desire of the Hungarian people has just been fulfilled," Apro told the gathering of diplomats, party and government officials, clergy from Hungary's major churches, and the chief rabbi.

In a letter to Apro, President Carter, said it was with "a genuine sense of pride" that he was able to return the crown. "I see in this act," he added "the reaffirmation of the traditional bonds of friendship between our people."

Carter also noted the "deepest respect" the American people have for the "religious and national significance" of the crown. He said they "share my pride in returning it."

The "national significance" cited by the President was also probably firmly in his mind in making the decision. The Carter administration, in reaching out toward Communist East European governments, has chosen to emphasize their traditions of nationalism, an emotion that might help loosen their binds to the Soviet Union.

The Roman Catholic primate of Hungary, Laszlo Cardinal Lekai, speaking informally with a newsman after the ceremony today, also praised the U.S. decision and said it would be greeted with great joy here.

Although the United States appears to be getting mostly goodwill out of the crown's return. The Hungarians clearly are hoping it will also set the stage for granting of most-favored-nation trade status with the United States which is now denied all Communist states except Yugoslavia, Poland and Romania.

Aside from gratitude over the crown's return, Apro also spoke of "a number of possibilities still to be exploited."

Apro was the highest-ranking Communist official at today's ceremony. Party chief Janos Kadar - who has ruled Hungary for 21 years - was absent from the 19th centruy neo-Gothic Parliament building, as had been anticipated.

Kadar's absense can be explained in part by the White House's insistence that the crown was being returned to the Hungarian people rather than to a Communist government, which took power in the wake of the Soviets tanks that crushed an uprising here in 1956.

The crown, despite its enormous national and religious significance in a country in which 60 per cent of the 11 million people are Catholic is also somewhat of a problem for Communist Party leadership. It does, in fact, represent Hungarian independence that started almost a thousand years ago when St. Stephen, according to legend, received the crown directly from Pope Sylvester II rather than via the Holy Roman Emperior.

Another touchy problem for Kadar is the commonly held view that the guards who first hid the crown in Hungary in late 1944 and ten took it to Austria and buried it in March 1945 were under orders to keep the national treasure from falling into the hands of the advancing Soviet army.

Today, in an interview with Reuter, Jozsef Bunda, one of the last surviving guards broke more than 30 years of enforced silence and described how the plot to keep it away from the Soviets was carried out.

Bunda, now 65, told Reuter about wrapping the crown jewels in rags and burying them in an empty oil barrel at Mattsee, near Salzburg, Austria. From there, the guards fled farther west toward Augsburg, Germany, where they were taken prisoner by U.S. troops, whom they eventually led about the crown."

When he came back after the war to a Communist government, Bunda said he was told, "just keep quiet forever about the crow."

After the ceremony a Hungarian honor guard carried the crown jewels into a black room of the Parliament building.

Though the crown has had a troubled past - threatened by invasions and greed - and has rarely been seen publicly, the return negotiated by the United States requires that it be put on permanent display here as soon as possible.