MOSCOW, MAY 28 -- The government of Soviet Armenia declared a day of mourning today following the deaths of at least 22 persons in armed clashes between Soviet internal security troops and members of militant nationalist groups.

Armenian Communist Party chief Vladimir Morsisyan went on television to appeal for calm after the bloodshed Sunday at the main railroad station in the Armenian capital, Yerevan, and an army base south of the city. A planned march through the city to commemorate Armenia's short-lived declaration of independence from Russia in 1918 became a commemoration of the dead.

The Armenian news agency Armenpress said that 20 civilians and two soldiers had died in the incidents, which Soviet authorities have blamed on nationalist groups trying to seize weapons from the army. More than 50 people on both sides were injured, several critically.

The flare-up of violence in Armenia is a vivid reminder of the the longest and most intractable ethnic dispute to confront President Mikhail Gorbachev since he came to power in March 1985.

The rise of an Armenian national movement in early 1988, fueled by a territorial dispute with neighboring Azerbaijan, served as a precursor for resurgence of nationalism in other parts of the Soviet Union.

In an interview, Soviet Interior Minister Vadim Bakatin accused Armenian authorities of failing to do enough to curb the arming of nationalist groups in the republic following clashes along the border with Azerbaijan earlier this year. He said Armenian activists had seized 1,200 automatic rifles from police stations in the last few months.

"The Armenian government must take tougher measures to disarm these groups," said Bakatin. Consulting his files, the minister said that the death toll from ethnic violence in the Soviet Union this year now stood at 332 -- more than the total for all of last year.

According to Bakatin, large numbers of armed militants gathered outside the internal security troops' barracks at Erubuni, south of Yerevan, Sunday afternoon following a shootout between troops and armed vigilantes at the railroad station in which six civilians were killed and 10 soldiers wounded.

Shots were fired at the barracks, as a result of which the deputy commander of the garrison, a lieutenant colonel, was killed and three soldiers injured, Bakatin said.

He said troops then opened fire on the crowd in self-defense, killing 14 and injuring 40. "Casualties were much higher on their side, since our troops were obviously better armed," he said.

Bakatin's version was disputed by the Armenian National Movement, the most prominent nationalist organization in the republic, which said that innocent civilians had died in the cross-fire. A spokesman for the group said that a 13-year-old girl was among those killed after the army opened fire on gunmen manning a barricade not far from the barracks.

Sporadic clashes continued in the Yerevan region through the night, according to local journalists. Just before midnight, gunmen attacked policemen guarding the headquarters of the Armenian government -- next to a statue of Soviet state founder Lenin -- and seized 14 handguns and a supply of cartridges.

The Soviet Interfax news agency said bands of between 15 and 20 gunmen had attacked army posts in other regions of Armenia during the night, seizing weapons and injuring several soldiers. Similar incidents have been a nightly occurrence for the last week.

Tension also was reported high in the largely Armenian-populated enclave of Nagorno-Karabakh in Azerbaijan, control of which has been at the center of the dispute between the two southern Soviet republics.

Last week, the Armenian government defied Moscow by allowing Armenians in Nagorno-Karabakh to vote in elections for the new Armenian legislature, and today troops occupied the main square in Stepanakert, the provincial capital, to prevent a demonstration marking Armenian independence day.

The head of Soviet internal security troops, Gen. Yuri Shatalin, who is in Yerevan, has described the situation in Armenia as explosive, and he said today that armed bands were building up huge arsenals of weapons. "Our troops do not want this bloodshed, but the terrorists are forcing them into it," he said.

The official Tass news agency reported that Shatalin had met with leaders of armed Armenian groups over the weekend to call on them to lay down their arms. The agency said that his request was rejected.