RIGA, U.S.S.R., JAN. 21 -- The Latvian parliament called today for more volunteers to defend the Baltic republic's nationalist government against further attacks by Soviet forces and demanded withdrawal of "Black Beret" internal security troops who stormed the Latvian Interior Ministry here Sunday night, leaving at least four people dead and nearly a dozen wounded.

By late morning, the parliament building -- already surrounded by reinforced concrete barricades -- looked like a fortified encampment as helmeted Latvian police and militiamen wearing bullet-proof vests and toting sub-machine guns took positions at windows and patrolled the hallways.

Later, film of the night assault at the ministry building run on Latvian television showed a furious gun battle marked by the continuous rattle of automatic weapons and the glow of tracer fire as the Black Berets stormed the building. By morning light -- and after the Soviet troops had left -- crowds of people gathered around the building, its windows now smashed, its walls gouged by bullets, and talked with policemen who had tried to defend it or laid flowers at the entrance in memory of the dead.

Reporters allowed into the building saw dried blood caked on stairways on the upper floors of the five-story structure. Doors and locks had been blown apart by machine-gun fire. Bullet holes ringed a wall portrait of Soviet President Mikhail Gorbachev.

The violence, the worst in Latvia since the harsh Kremlin crackdown against secessionist moves in the three Baltic republics began earlier this month, followed by one week a Soviet army assault on a television station in neighboring Lithuania that left 13 civilians dead and 200 wounded. "The purpose of this attack was to destroy the political situation in Latvia, to intimidate us," said Nikolai Neiland, a Latvian member of the Soviet legislature in Moscow who has met frequently with Gorbachev in recent weeks. The pro-Moscow Communist forces in Latvia "realize that the president needs reasons, pretexts, if he is going to declare presidential rule here. These {Black Berets} regard themselves as heroes in a thriller, a Wild West film, like some sort of Rambos."

Latvian President Anatolijs Gorbunovs will meet Tuesday in Moscow with Gorbachev, and the two could agree to limited presidential rule here to forestall further violence in the republic, according to Anatoli Denisov, a Soviet legislator who spent three days in Latvia last week investigating the crisis.

Denisov said that under such an agreement, the democratically elected Latvian parliament would not be dissolved, as the local Communist Party has demanded, but would be directly accountable to Gorbachev.

Unlike Lithuanian President Vytautas Landsbergis, who has rejected direct rule from Moscow as "appeasement," Gorbunovs has said that a compromise on the issue may be a way to prevent more bloodshed.

Landsbergis, who has argued passionately that the Soviet Baltic republics -- Lithuania, Latvia and Estonia -- must continue the struggle to reclaim their pre-World War II independence, said today that the three must be prepared to aid each other in the confrontation with Moscow. Addressing the Lithuanian parliament on the attack in Latvia, Landsbergis accused the Kremlin of "terrorism against democracy" and compared the Soviet Black Berets to the Ton-tons Macoutes, the paramilitary force that terrorized Haiti during the Duvalier dictatorship.

The 120-man unit of Black Berets in Latvia -- many of them veterans of the Soviet invasion of Afghanistan -- is part of a Soviet Interior Ministry force of about 30,000 that is known formally as the Special Mission Police Squad, or, by its Russian acronym, the OMON. But Soviet Interior Minister Boris Pugo told a Latvian official today that he neither controlled the Black Beret unit in Riga nor ordered the attack. Pugo said that the Black Berets would be removed from Latvia but did not say how or when, according to the Latvian official.

Latvian authorities said they had been told last week that the Black Berets had been placed under the control of a pro-Moscow, so-called National Salvation Committee, which has declared twice in recent days that it had seized power in the republic. But Alfreds Rubiks, leader of the local Communist Party and head of the committee, has denied any connection between his group and the troops.

Like last week's paratroop attack on the television station and transmitting tower in Vilnius, the Lithuanian capital, the assault here has spawned deep animosity against Moscow. Suddenly, Riga, especially Old Town, its ancient heart, has the feeling of a city under siege.

Workmen using cranes have lifted huge concrete barriers into place to cut off Old Town -- site of the parliament building -- from attack. Women and children have been warned to avoid Old Town's Duomo Square and its 18th-century Lutheran cathedral. Inside the cathedral, meanwhile, doctors and nurses have set up an emergency medical clinic amid the pews.

"Now all of us are under threat from the Communist Party, from the military, from these Black Berets. We have to be prepared for even more blood," said Mara Burkevica, a doctor who helped treat Latvian filmmaker Andris Slapins, who was shot in the head during the assault on the Interior Ministry and died shortly afterward. Two Latvian policemen also died, as well as an unidentified young man. Initial reports of a fifth death in the attack could not be confirmed today.

"This is the last attempt of the Communist Party and the army to hold onto their power," said Yakov Model, a young man who stood outside the shell-pocked ministry building this morning. "If they use their guns, they can win. They know that. But in the end, they all will lose. We despise them."

According to a version of the 9 p.m. assault issued by Soviet spokesmen, the Black Berets at first sent a small group of their number to the Latvian ministry to "negotiate" after the wife of one of them claimed she had been raped, presumably by someone inside the building. In this version, the Black Berets said they were shot at from the building and that only then did they return fire and storm the ministry.

Latvian officials rejected this scenario as "a complete fiction," saying there had been no rape, and witnesses told reporters that more than 100 Black Berets set upon the building en masse as people in the street shouted "Fascists! Bastards!" Witnesses said the shooting both outside and inside the building continued for about 40 minutes and that some Black Berets were firing on the ministry from the roof of the nearby public prosecutor's office. A member of the Leningrad City Council, Alexander Sungurov, said he saw nine Latvian policemen marched out of the building by Black Berets.

Latvian Premier Ivars Godmanis said he called Pugo in Moscow at 10:50 p.m. and that Pugo -- a former head of the Latvian KGB -- said he had not ordered the attack but would try to control the situation. Another Latvian official said he telephoned Soviet Defense Minister Dmitri Yazov, but that Yazov refused to discuss the issue, saying the Soviet legislature should deal with it.

The Black Berets controlled much of the building until about 2 a.m. this morning, when Godmanis reached an agreement with their commander that the troops would return to their barracks. Latvian officials have complained previously about Black Beret "provocations" in Riga, including the shooting last week of a driver employed by the republic's transport ministry and a Black Beret raid on a Latvian police academy in which a number of trainees were roughed up and weapons were confiscated.