Three soldiers were killed and 126 people wounded in Azerbaijan when riots triggered by a territorial dispute with Armenia swept through two southern Soviet cities, an Azerbaijani official said Wednesday.

Musa Mamedov, chief of the information department of the Azerbaijan Foreign Ministry, said the violence occurred in the Azerbaijan cities of Nakhichevan and Kirovabad with the arrival of Interior Ministry troops on Tuesday."Three soldiers were killed, perhaps by stones, perhaps by sticks," Mamedov said in an interview from Azerbaijan's capital, Baku. "A total of 126 people in the two cities were injured." He said a state of emergency was proclaimed in the two cities.

It was the first official report of the death of soldiers or policemen in Azerbaijan or Armenia since an ethnic dispute broke out in February over Nagorno-Karabakh, a mostly Armenian region of Azerbaijan whose legislature has demanded unification with Armenia.

State-run Baku radio, monitored in London, said an unspecified number of people also were injured in Nakhichevan, the administrative center of an enclave of Azerbaijani territory that borders Iran.

The radio said crime and looting had been on the increase since Monday, and people's lives were in danger. It said some police had not been fulfilling their duties, but that "the city's leadership is taking immediate measures."

In February, anti-Armenian riots shook another Azerbaijan city, Sumgait, and Soviet officials said 32 people, among them 26 Armenians, were killed. Armenians claim the death toll was much higher.

Tens of thousands of Armenians massed Tuesday night in Yerevan, their capital, and voted to form "self-defense squads" as initial news of the unrest in Azerbaijan became known in the city.

In Baku, thousands of Azerbaijanis were reported gathered in the main square Wednesday as round-the-clock, anti-Armenian protests there entered a fifth day. A reporter with official Azerbaijan television estimated the number of protesters at 800,000, almost half of Baku's population of 1.7 million.