MOSCOW, AUG. 30 -- Armenian President Levon Ter-Petrossian won a critical victory today as he gained the promise of an independent militia organization to disband after a series of violent clashes with rival groups in the republic had left six people dead.

Following a long standoff at their headquarters in the Armenian capital, Yerevan, leaders of the Armenian National Army (ANA) surrendered their weapons to the Soviet republic's military authorities and called on their members to do the same.

Ter-Petrossian, an Armenian nationalist who won the top leadership post in the republic and then engineered the legislature's declaration of independence this month, had sought to end the standoff before the Kremlin sent in army troops. Soviet President Mikhail Gorbachev has given all independent militia groups in the republic until early October to turn in their weapons.

Ter-Petrossian had declared a curfew and state of emergency in the republic Wednesday after ANA troops fatally shot six people, including a member of the Armenian legislature who was trying to investigate armed attacks on local gasoline stations. Militia groups reportedly have been raiding filling stations for gasoline to continue their battles with Azerbaijani paramilitary forces along the border between the neighboring Soviet Transcaucasian republics.

Armed members of the Armenian National Movement, a nationalist group controlled by the Yerevan government, had surrounded the ANA's headquarters Wednesday night. ANA leaders at first asked to be allowed to join the Armenian National Movement, but the request was rejected. Later, as movement forces began to advance on the building, more than 200 ANA troops inside surrendered. About 50 others escaped with their weapons, according to official news reports.

Ter-Petrossian said the militiamen surrendered without any shooting or violent resistance. "Today was the quietest day in the past six months in this republic," he told the Armenian legislature. Ter-Petrossian said that the ANA still held several stolen buildings and various weapons and that he would give it a few more days to fulfill the legislature's demands for its total disbanding.

Two ANA leaders, Razmik Vasiliyan and Vartan Vartanyan, appeared on television later in the day and appealed to their members to surrender their arms. ANA troops in other Armenian cities, including Ashtarak and Kirovakan, also turned in their arms. About 1,000 pounds of ammunition and various arms were found in their abandoned headquarters.

The Armenian legislature, which outlawed the ANA Wednesday, has said it would grant immunity to those who surrender but would mete out strict punishment to those who continue to bear arms without government approval.

An article of the legislature's recent declaration of independence asserted that Armenian, and not Soviet, authorities have the right to establish an army in the republic. Ter-Petrossian used officials and troops of the republic's Interior Ministry and KGB to defuse the crisis.

The ANA, which formed in the wake of January's virtual civil war with Azerbaijan, is the largest of several Armenian militia groups, which are said to total about 10,000 troops. The militias have been stealing arms from local Soviet army caches and carrying out raids along the Azerbaijani border.

Armenia, which is predominantly Christian, and Azerbaijan, which is mainly Moslem, have been at odds for decades, but their conflict intensified 2 1/2 years ago in a dispute over control of Nagorno-Karabakh, a mountainous enclave populated chiefly by Armenians but administered by Azerbaijan. Hundreds have since died in clashes between the two peoples.