MOSCOW, FEB. 23 -- In one of the largest nationalist protests ever held in the Soviet Union, tens of thousands of Armenians demonstrated in the streets of their regional capital last night to demand that they be joined with their compatriots in a neighboring republic, dissident sources reported today.

It was the second ethnic protest in the Soviet Union this month and came only days after Soviet leader Mikhail Gorbachev told a Communist Party plenum that nationalist tensions were "the most fundamental, vital issue of our society."

According to the Soviet government newspaper Izvestia and the official news agency Tass, demonstrations erupted in the streets of the Armenian capital, Yerevan, and in Stepanakert, in the neighboring republic of Azerbaijan, as Armenians in both areas protested the 1923 decision to divide them by setting up an autonomous region in Azerbaijan.

The official Soviet media did not provide estimates of the number of protesters, but Armenian dissident sources in Moscow said that at least 50,000 were involved.

The demonstrations had grown so much by Monday that Armenian Communist Party leader Karen S. Demirchyan appealed on television and in newspapers for calm to be restored in the region and gave assurances that the Armenian nationality problem would be addressed.

Armenia and Azerbaijan are two of the 15 Soviet republics. The demonstrations taking place are part of a wave of nationalist protests that started in late 1986 when a violent riot broke out in Alma Ata, capital of the Central Asian republic of Kazakhstan. Last week a peaceful nationalist demonstration was broken up by Soviet police in the Baltic republic of Lithuania.

Activists in another Baltic republic, Estonia, have urged residents to gather on Wednesday in the streets of the Estonian capital, Tallinn, and four other cities to demonstrate their desire for autonomy.

The Armenian demonstrations started in Azerbaijan's autonomous region of Nagorno-Karabakh two weeks ago, eventually spread to Yerevan and continued until today, Soviet dissident Alexander Ogorodnikov said in an interview in Moscow today.

The squabble dates back to before the 1917 Russian Revolution. Nagorno-Karabakh, 95 percent Armenian, became an autonomous republic at the beginning of Soviet rule. But the region, which now has a population of 160,000, was made part of Azerbaijan by a Kremlin decree in November 1923, according to an official Soviet encyclopedia.

The new protests were touched off on Feb. 11, Izvestia reported today, when Armenians in Stepanakert, the largest city in Nagorno- Karabakh, pasted up posters with their demands to be rejoined to the Armenian republic. Schoolchildren and students began to boycott classes and demonstrations broke out, Izvestia said.

Last Friday thousands of Armenian demonstrators, in solidarity with protesters in Nagorno-Karabakh, gathered around the opera house in Yerevan, according to Ogorodnikov, a former Soviet political prisoner who lives in Moscow but maintains close contact with sources in Armenia.

Daily demonstrations in Yerevan continued through the weekend and Demirchyan made his appeal to the public yesterday.

Relations between Azerbaijan and Armenia are usually tense because of religious differences. Azerbaijan is largely Shiite Moslem while Armenia is predominantly Christian. Protests in the region have occurred before, but have always been contained in a limited area.

The Kremlin leadership, in reaction to the flare-up, sent nonvoting Politburo members Georgi Razumovsky and Pyotr Demichev to the area early this week and passed a resolution calling on local party leaders there to resolve the conflict. In a message to party leaders in Nagorno-Karabakh, Razumovsky said that the Soviet Central Committee had found the demands of the protesters unjustifed.

According to Izvestia, however, local party leaders acknowledged that the demands of the demonstrators should be addressed. Deputies of the party committee in Nagorno-Karabakh had passed a resolution calling for a reexamination of the question, Izvestia said.

But, in a signal of a rift between Moscow and local leaders over the issue, Razumovsky told party officials in Stepanakert yesterday that "the party Central Committee considers actions and demands directed at a review of the existing national territorial situation {to be} against the interests of the workers of Azerbaijan and Armenia," Izvestia said.

The dispute is similar to a continuing disagreement between Crimean Tatars and the Kremlin leadership over whether the Tatars should be allowed back into their own autonomous republic, which was taken from them after World War II.

The Crimean Tatars, who staged a major demonstration in Moscow last summer to protest their ouster from the Soviet Crimea, are among several nationalities who have attracted attention here in the past year. At a Central Committee meeting in Moscow last week, Gorbachev proposed that a special Central Committee plenum be held on the issue.