Three Soviet Embassy officials kidnaped by gunmen a month ago were freed unharmed today, two days after Syrian officials met with Lebanese Moslems and leftists to press for their release.

Jubilant Soviet diplomats publicly credited "the help of all our friends" in the region, including Syria, for the resolution of the crisis, but they gave no details of how it was achieved.

The official Syrian Arab News Agency said tonight that "special security agencies" had "secured the release of the three Soviets" but it did not elaborate.

A statement telephoned to news agencies in the name of the Islamic Liberation Organization, which had claimed responsibility for the kidnaping, said the Soviet "spies" had been released as a gesture of "good will" and as a reminder of the captors' original demand for an end to attacks on Islamic fundamentalist forces in Tripoli, in northern Lebanon. The attacking forces are backed by Syria, the chief Soviet ally in the region.

The message made no mention of the slaying of a fourth kidnaped Soviet, Arkady Katkov, whose bullet-riddled body was found in a desolate area of Beirut on Oct. 2, two days after the four were seized while driving near the Soviet Embassy in Moslem west Beirut.

There also was no indication of any progress toward the release of six Americans who have been held captive here for periods ranging up to 19 months.

[In Washington, a State Department spokeswoman said the United States welcomed the release of the Soviets but she added that "we also call upon those holding the American and other foreign hostages in Lebanon to release them forthwith."]

The three Soviets -- attache Oleg Spirine, commercial representative Valery Mirikov and embassy physician Nikolai Svirsky -- reportedly walked to their embassy early tonight after being let out of a car by their captors a few blocks away.

Lebanese leftist sources said the Soviets, although healthy, were tired and looked haggard after their ordeal and were examined by doctors at the embassy. Officials did not allow reporters to talk to them.

A senior Amal official, Qabalan Qabalan, arrived with a Syrian military observer and was allowed into the embassy to greet the freed Soviets, however, as were members of the Syrian-backed National Palestinian Salvation Front.

West Beirut resounded with a deafening din that frightened many residents as Moslem and leftist militiamen fired rockets, rifles and antiaircraft guns to mark the release -- a traditional method of celebration here. Soviet Embassy personnel, upon hearing of the freeing of their comrades, rushed to a store and bought whisky and vodka to celebrate, shopworkers said.

Embassy First Secretary Vladimir Beskournikov could not conceal his joy and laughed heartily when he was reached by telephone to confirm the release.

"They are free," he said. "They managed to make it with our help and the help of all our friends. They are safe and in good health but they are tired and must have a rest."

"There are so many friends who assisted us, so many organizations," he said. Asked if Syria had been involved in the hunt, he said, "Yes, yes of course," but he refused to give details of how the Soviets' captors had been persuaded to let them go.

There were widespread reports and evidence, however, that the Soviet Union and Syria, which has several thousand troops in Lebanon and was highly embarrassed by the kidnaping, had begun an all-out effort to gain the captives' release.

Syria's intelligence chief in Lebanon, Col. Ghazi Kanaan, met with leaders of Lebanese Moslem and leftist factions two days ago and urged them to bring the crisis to a conclusion.

Arab diplomatic sources here were quoted as saying Syrian President Hafez Assad had received a letter from high-ranking Soviet officials requesting decisive action for a "positive ending" to the affair.

Moslem and leftist militia, mainly the Druze Progressive Socialists and the Shiite Moslem Amal, had been actively searching for the Soviets since last week. The militias were storming suspected hideouts in neighborhoods believed to be under the control of Sunni and Shiite fundamentalist underground groups.

Diplomatic sources in Damascus recently said Syrian authorities had identified the group responsible for the Soviet abductions and that it is believed to be linked to the Islamic Council of Ulemas, a coalition of extremist Moslem clergymen.

The statement by the Islamic Liberation Organization, distributed a half hour before the Soviet captives turned up at the embassy, said that, in Tripoli, "we became aware that Syria and its allies, the Russian masters," were controlling the battle, "and we could see in front of us visions of the Soviet massacres and the horrific aggression against Moslems in Afghanistan. We as Moslems had to retaliate fiercely and cruelly."

Since the abductions and the slaying of Katkov, Syria has markedly softened its approach in dealing with the fundamentalist Islamic Unification Movement in Tripoli, although factional fighting has continued sporadically.