BAKU, AZERBAIJAN -- The government of this Caucasian republic has hired a force of more than 1,000 Afghan mujaheddin fighters to buttress its sagging army, introducing a volatile new element to the five-year Azerbaijani-Armenian war on the former Soviet Union's southern rim.

The deployment, unprecedented since the collapse of the Soviet Union almost two years ago, is part of President Gaidar Aliyev's campaign to save the integrity of his Caspian Sea republic of 7 million people. Azerbaijan has lost 40 percent of its territory and about 1 million people have become refugees in the conflict with ethnic Armenians battling for independence in the Azerbaijani enclave of Nagorno-Karabakh.

As a sign of his tenuous situation, Aliyev, a former Communist Party boss, also has aggressively sought direct military support from the United States, Iran and Turkey, according to several Western diplomats. Aliyev's face-to-face appeal last week to U.S. Ambassador to Azerbaijan Richard Miles was rebuffed, according to Western sources, and the forces sent by Afghan Prime Minister Gulbuddin Hekmatyar so far have been unable to help the Azerbaijani army repel a surging ethnic Armenian offensive.

"We estimate that it would take two days for the Armenians to march straight into Baku," a Western diplomat said last week. "They would be almost unopposed. This city is defenseless."

Western analysts do not expect the Armenians to push as far as Baku. However, the relentless Armenian advance, in which a large swath of southwestern Azerbaijan bordering Iran was seized and burned just two weeks ago, seems on the verge of plunging Baku into a new political crisis, diplomats said. Five Baku governments have fallen in the last two years over the war, and Aliyev, who came to power in June in a military coup, "is in real trouble," one Western diplomat said.

"Aliyev's time is up," the diplomat said. "He needs to do something radical. He needs Turkish, Iranian, somebody's backing."

Aliyev's move comes at a propitious moment for Azerbaijan, which is about to become one of the former Soviet Union's wealthiest republics. Azerbaijan is soon to receive the first $250 million of an estimated $94 billion, 35-year windfall from its rich offshore oil fields. The signing bonus, to be paid by an eight-company Western oil consortium, would help pull Azerbaijan back from the verge of economic collapse. But, diplomats say, the money may do little to stave off political collapse if Aliyev is unable to improve Azerbaijan's performance on the battlefield.

The deployment of Afghan forces to save a former Soviet republic is ironic since many historians believe that Moscow's 1989 withdrawal of its troops from Afghanistan marked the start of the Soviet Union's decline that ended with the superpower's December 1991 collapse.

The Afghan soldiers, identifiable by their trademark round, flat woolen caps and shin-length cotton robes, started arriving in August, soon after a visit to Afghanistan by Azerbaijani Deputy Interior Minister Roshan Jivadov, the diplomats said. Hekmatyar, the Afghan prime minister, approved the deployment for an undisclosed sum, the diplomats said. Azerbaijan and Afghanistan are both Muslim nations, while Armenia is largely Christian.

The Afghan force, which diplomats estimate at between 1,000 and 1,500 men, is part of the Iran-backed mujaheddin faction called Hezb-i-Wahdat, which is allied with Hekmaytar. Although Tehran finances and influences the party, it is unclear what role, if any, Iran played in the deployment in Azerbaijan, diplomats said.

The Afghans' first major action came two weeks ago when Baku launched a surprise offensive in the Zangelan region, near Iran. A force of ethnic Armenians immediately repulsed the Azerbaijani assault, which the Afghans either spearheaded or helped lead, diplomats said, and then the Armenians pushed out the local population of some 60,000 Azerbaijanis.

The Azerbaijani force, including the Afghans, appear to have fled when the counteroffensive began, diplomats said.

The Afghan presence is producing concern among some diplomats, who cited unconfirmed reports of tension between some mujaheddin fighters and members of the local population. An estimated 1 million Afghans and 13,000 Soviets died during the decade-long Soviet army presence in Afghanistan.

"It's a very dangerous thing to bring in the Afghans," said a senior Western diplomat. "They have very mixed feelings. Many of them had relatives killed by these very same people {former Soviets}."