MOSCOW, JAN. 21 (MONDAY) -- Soviet internal security troops attacked the Latvian Interior Ministry in Riga Sunday night, leaving five people dead and nine wounded in the latest battle over political control in the Soviet Baltic republics, according to the Latvian parliament's information office.

A Latvian parliamentary spokesman said that about 100 members of a Soviet anti-terrorist unit known as the "black berets," which is loyal to the Kremlin, took over the ground and top floors of the building in a burst of gunfire shortly after 9 p.m. Outnumbered Latvian police battled to defend other floors for about 90 minutes but were overpowered, the spokesman said. Early this morning, after about six hours in which they apparently searched the building for weapons, the troops left the building.

The Soviet military commander in the region had demanded last Monday that Latvian police surrender their arms, a demand rejected by Latvian Interior Minister Aloizs Vaznis. "Black beret" units then raided a Latvian police academy outside Riga, the Latvian capital, shoved aside a dozen trainees and confiscated an undetermined number of weapons.

Few other details were available on Sunday's attack, which came just hours after tens of thousands of demonstrators massed in Moscow to denounce last week's army crackdown in neighboring Soviet Lithuania, where paratroops stormed a television station, killing at least 13 civilians. The demonstrators, estimated at between 100,000 and 300,000, demanded a halt to suppression of democratic movements around the country and called for the resignation of Soviet President Mikhail Gorbachev.

The Latvian spokesman identified a civilian killed at the Interior Ministry building in Riga as Andris Slapins, a cameraman who was filming the attack. Other casualties included two Latvian policemen who were defending the building, the spokesman said.

The seizure of the Interior Ministry, which was a potential focus of Latvian resistance because of its role in directing the republic's newly organized police force, appeared to mark an escalation in the continuing power struggle in the Baltic republics, all three of which have begun moving to secede from the Soviet Union.

The "black berets" were formerly under the command of the Soviet Interior Ministry, but last week were transferred to a Communist-dominated so-called National Salvation Committee in Latvia that announced Saturday it was seizing power in the republic.

In Washington, White House spokesman Bill Harlow said President Bush was "deeply troubled" by the events in Latvia and was monitoring the situation. The State Department contacted the Soviet Embassy late Sunday afternoon, asking that it transmit to Moscow an urgent U.S. request to end the violence.

U.S. officials said it was unclear whether Bush would take any formal steps to protest the Baltic crackdown, such as cancelling the Moscow summit scheduled for Feb. 11-13. Bush said Friday that he had stressed his demands for a peaceful solution in the Baltics in a phone conversation with Gorbachev, the second time in a week he had made that point to the Soviet president.

The demonstrators in Moscow's Manezh Square chanted, "Lithuania today, Russia tomorrow!" suggesting that the military action in the Baltics could be the start of a more general crackdown throughout the Soviet Union. Smaller demonstrations took place in Leningrad, Kiev -- the Ukrainian capital -- and a half-dozen other Soviet cities.

The rallies demonstrated that the Soviet democratic movement is very much alive despite Gorbachev's sharp shift toward a more hard-line position in recent months. But the mood was grim, and many demonstrators agreed that such protests are unlikely to be very effective if the Kremlin decides on full-scale repression.

Nearly a year ago, more than 100,000 demonstrators rallied at the same Moscow square to press the Communist Party to give up its constitutional guarantee of power. At that rally, however, many of the demonstrators had expressed support for Gorbachev against his hard-line opponents.

At this Sunday's rally, the protesters shouted, "Dictatorship will not pass!" and "Down with the Communist Party!" In a message to the demonstrators, Russian republic President Boris Yeltsin said that the "danger of dictatorship" is becoming a reality, but he declared he still is prepared to talk with Gorbachev.

"Economic reform has been blocked, democracy betrayed, glasnost trampled upon. Arbitrariness and lawlessness are being restored in the Soviet Union," Yeltsin said in the message. Aides said the Russian leader did not appear in person because of fears of a possible assassination attempt.

Leading radical-reform politicians, including Leningrad Mayor Anatoly Sobchak, have called for the formation of a national coalition government based on the core Soviet republics of Russia, the Ukraine, Byelorussia and Kazakhstan. They have argued that such a coalition could represent the last chance of averting a military-backed countrywide crackdown and the restoration of authoritarian rule.

Gorbachev's allies insist that he is still ready for a dialogue with advocates of radical reform, despite the recent removal of leading political moderates from his inner circle.

Speakers at the Moscow demonstration called for the resignation of Gorbachev, Defense Minister Dmitri Yazov, KGB chief Vladimir Kryuchkov and Interior Minister Boris Pugo, accusing them of authorizing the storming of the television station in Lithuania. "We are to say a decisive 'No' to the reactionary policy of Gorbachev and his team," shouted historian Yuri Afanasyev, a radical Soviet legislator who was the main speaker at the rally.

Yeltsin has summoned the Russian legislature into emergency session today to discuss the country's political crisis. Some Russian lawmakers believe that they could be asked to approve direct presidential elections in Russia to strengthen Yeltsin's political authority.

A resolution adopted at Sunday's Moscow rally called for immediate withdrawal of "punitive forces" from the three Baltic republics and arrest of the leaders of what it called an "attempted coup" there. In both Lithuania and Latvia, self-proclaimed "national salvation committees" dominated by pro-Moscow Communists have announced that they are taking power, overturning the republics' democratically elected parliaments.

Saturday's claim by the Latvian National Salvation Committee that it was seizing power was ridiculed by the Latvian government, which said it remains in full control in the republic. A parliamentary spokesman said Latvian Prime Minister Ivars Godmanis called Yazov in Moscow to protest the attack but that Yazov said he had no knowledge of it. Godmanis then called Interior Minister Pugo, a former head of the Latvian KGB, who promised steps to control the situation, the spokesman said.

Meanwhile Sunday, in Baku, capital of the Soviet republic of Azerbaijan, up to 1 million people gathered Sunday at a cemetery to commemorate the deaths of more than 100 people a year ago when Soviet troops stormed the city to quell ethnic rioting.