MOSCOW, AUG. 11 -- Soviet President Mikhail Gorbachev today extended by two months the deadline for nationalist groups to turn over their arms to the government in a move apparently aimed at easing tensions, especially in the Transcaucasus.

Gorbachev's decision follows a series of meetings between national government leaders, including Prime Minister Nikolai Ryzhkov and Interior Minister Vadim Bakatin, with the new Armenian president, Levon Ter-Petrossian, and other presidents of the country's 15 constituent republics.

Last month, Gorbachev had given nationalist groups until last Thursday to turn over their arms. But many of the groups and republican governments defied the order, and confrontations with the Soviet army, especially in Armenia, appeared imminent.

The latest violence in the Transcaucasus came Friday when a bomb exploded in a bus in Azerbaijan, killing at least 17 people and injuring at least 15 others. The bus, which was heading from the republic of Georgia toward the Azerbaijani town of Agdam, was carrying about 60 people. The bomb exploded near Gyandzha, near the disputed region of Nagorno-Karabakh. It is not known who planted the bomb, but Azerbaijanis are likely to suspect Armenians.

Ever since anti-Armenian violence broke out last winter in the Azerbaijani capital of Baku and along the border of the two republics, thousands of Armenian militants have formed paramilitary groups, often using weapons stolen from local Soviet army regiments.

Ter-Petrossian has said there are no more than 5,000 or 6,000 such paramilitary troops, although Moscow officials say the numbers run into the tens of thousands. The Communist Party newspaper Pravda said that in Armenia about 6,700 guns and 1,200 machine guns had been stolen from government arms depots. Nationalist groups in other areas have also plundered Soviet arms supplies.

To avoid confrontation with the Soviet army, Ter-Petrossian, a prominent nationalist leader for 25 years, told Soviet officials that he intends to make sure that all paramilitary troops are brought under the control of the newly elected Armenian parliament.

Ter-Petrossian reportedly told Bakatin that all stolen firearms would be turned in. Bakatin said that since Gorbachev gave his ultimatum last month about 100,000 rounds of ammunition and 1,600 guns had been turned in voluntarily or recaptured.

The hostility between mainly Christian Armenia and Moslem Azerbaijan has deep historical and political roots, and in recent years has focused on the control of a moutainous enclave, Nagorno-Karabakh, which has a mainly Armenian population but has been under Azerbaijani rule since 1922.

The Armenian and Azerbaijani parliaments insist they have rights to the enclave. Nagorno-Karbakh has been the scene and source of so much violence for the past two years that one Soviet official called the region "our domestic Lebanon."