LOS ANGELES (AP) _ Thousands of Armenians marched to City Hall on Saturday, carrying flags and chanting in a show of solidarity with a Soviet republic involved in a territorial dispute on the other side of the globe.

Mounted police kept watch as the demonstrators gathered in Pershing Square before winding through downtown, singing and chanting and carrying signs and banners. Police estimated the crowd at 5,000 people.

Saturday's protests in California were triggered by rioting that began late last month in the Soviet Union. Armenians in the port town of Sumgait, in the Republic of Azerbaijan, demanded that the region of Nagorno-Karabakh be united with the Republic of Armenia. Nagorno-Karabakh, populated largely by Armenians, is currently a part of Azerbaijan.

Soviet Police and militia have moved into the region to calm tensions in the adjacent republics in the Soviet Union's southwest corner. Some reports claim 32 people have died while others put the death toll much higher.

''We want to show our solidarity with our people and the protests taking place in Soviet Armenia,'' said Lorig Titizian, executive director of the Armenian National Committee Western Region, which organized the demonstration.

The procession to City Hall was led by about 15 black-robed Armenian priests walking beneath a sign that read, ''No brotherhood without justice.''

''We are marching to express our unity with Armenians living both in Karabakh and in Armenia and in America,'' said the Rev. Arsag Chatchadourian.

Harold Ezell, Western regional commissioner of the Immigration and Naturalization Service, was one of the few speakers to address the crowd in English.

''I believe that in the state of California, where we have a first- generation Armenian as governor ... we should do everything we can to support our friends,'' Ezell said, referring to Gov. George Deukmejian.