MOSCOW, MARCH 1 -- In a rare admission that Soviet troops have been deployed to maintain internal order, the Soviet government announced today that infantry units in armored personnel carriers were enforcing a curfew in the riot-torn city of Sumgait in the Moslem republic of Azerbaijan.

The night curfew was imposed following a violent rampage Sunday, Foreign Ministry press spokesman Gennadi Gerasimov said today. He said he believed troops were still deployed in the streets and described the atmosphere as "calm but tense."

The curfew was in effect for the last two days from 7 p.m. to 8 a.m., according to a Communist Party official in Sumgait reached by telephone.

In addition to troops and personnel carriers, Soviet authorities are using the state-controlled media in efforts to restore order in Sumgait. An appeal by leader Mikhail Gorbachev for reason and calm, first broadcast throughout the republics of Azerbaijan and Armenia Friday, is being repeated in Sumgait by radio and television, said a journalist there reached by telephone.

The television is offering clips of Azerbaijani, or Azeri, and Armenian music groups playing together, a local journalist said, interpreting that as an attempt to combat the impression of deep-seated strife between the two ethnic groups.

The tough response to the ethnic outbreaks appeared to reflect a strong resolve in the Kremlin to stamp out nationalist-inspired protests. Clashes are unusual in Soviet cities, whose streets are policed heavily.

The decision to send in troops to restore order seemed to indicate that the disturbances in Sumgait, a city of 223,000 in an oil-producing region 22 miles from Baku, the Azerbaijani capital, were quite violent. A Soviet journalist reached by reporters said several people were injured Sunday.

"If there are acts of violence," Gerasimov said, "then there are certain injuries." The Baku-based journalist attributed the clash to a group of teen-agers, "juvenile delinquents."

The rioting, reported here yesterday by Tass, broke out the same day that news of killings in an earlier clash in another part of Azerbaijan was broadcast, raising the possibility that the protesters sought to avenge those deaths.

The rioting in Sumgait occurred one day after two weeks of mass protests by Armenians were halted in their republic's capital, Yerevan. The timing has suggested that the Azeris in Sumgait rioted in response to a triumphant mood among Armenians during their protests.

Demonstrators in Yerevan were demanding the unification of an ethnic Armenian enclave, Nagorno-Karabakh, which is part of Azerbaijan, with Armenia. They agreed to disperse on Saturday after Gorbachev reportedly agreed to consider their appeal.

The Yerevan demonstrations drew crowds of 100,000 or more, according to sources there. The deaths took place in a clash between Azerbaijanis and Armenians in Nagorno-Karabakh, according to an official account.

The wave of unrest in Nagorno-Karabakh underscored a long history of religious and ethnic squabbles in the area between Christian Armenians, who comprise at least 75 percent of the enclave's population, and the predominantly Shiite Moslem Azerbaijanis.

Although the information released officially in Moscow about the riots was terse, the very existence of the reporting by the official news agency Tass and the follow-up statements by Gerasimov were indications that the new policy of glasnost, or openness, is being applied in nationality conflicts.