The government of Prime Minister Robert Mugabe finally has agreed to establish diplomatic relations with the Soviet Union after more than 10 months of stonewalling.

The agreement announced today, however, contained unusual conditions that Western diplomats called "embarrassing and humiliating" for the Soviet Union.

Under the terms, the Soviets have been forced to cut all ties with the minority Patriotic Front party of Joshua Nkomo, the organization that Moscow heavily supported during the seven-year guerrilla war for black-majority rule.

The agreement was reached after two weeks of negotiations, the third Soviet effort since last April, between the Foreign Ministry and a delegation led by the Soviet ambassador to Mozambique, Valentin Vdovin.

"The two delegations emphasized that diplomatic relations will be on a government-to-government basis only," the agreement said, "and that the two governments will not enter into any agreements, arrangements or negotiations with any organization without prior consultation and explicit approval of each government."

Moscow had sought to maintain ties with the Patriotic Front, which had an office in the Soviet capital until recently. During the war, the Soviets recognized Nkomo's organization as the sole Zimbabwean liberation group and did not deal with Robert Mugabe's Zimbabwe African National Union, which received much of its support from China and Yugoslavia.

Mugabe is now prime minister. He has a nominal coalition with Nkomo, but the Patriotic Front has been given little power or trust by Mugabe's group. This is partly because of clashes between the front's Soviet-equipped former guerrillas and forces loyal to Mugabe.

The signing comes only one week after serious clashes in the southwestern part of the country between the two sides. The government seemed sensitive about the announcement, apparently because of the internal political feud rather than diplomatic reasons. The agreement was signed Wednesday, but the announcement was embargoed until one minute after midnight today. A similar agreement was signed with Poland Wednesday.

When Mugabe registered a landslide victory in last February's elections, the Soviets were stunned. Most surprised of all was Vassily Solodovnikov, the Soviet ambassador to Zambia, who has close ties with Nkomo.

Solodovnikov, reputed to be the top Soviet diplomat in black Africa, made two fruitless visits to Salisbury to negotiate recognition last year before the Soviets switched to their ambassador in Mozambique, Zimbabwe's closest ally.

Vdovin succeeded after two weeks of negotiations, during which the Soviets reportedly had to drop their request to maintain ties with the Patriotic Front.

Western diplomats noted that it is highly unusual for governments to negotiate or impose conditions on establishing diplomatic relations with nation. Recognition is usually pro forma, accomplished by an exchange of notes rather than by formal written accord with conditions stipulated.

The agreement "is embarrassing and humiliating for the Soviets since it singles them out," one Western ambassador said. Another diplomat said, "It is not terribly polite in its implications."

Foreign Minister Witness Mangwende pointed out that this was the third Soviet delegation to come here for the negotiations, which "involved a wide-ranging review of past relations." He added that the opening of ties represented a "turning point" based on "noninterference in each other's internal affairs."

All major Western nations have had relations with Zimbabwe since independence or shortly thereafter. The United States made a point of being the first to open its embassy on independence day, April 18.

Analysts said the timing of the establishment of ties with the Soviets could be connected with an international donors' conference Zimbabwe is holding next month, at which it hopes for pledges of $2 billion in aid. Although not expected to provide much aid, the Soviets were invited to the conference, but were thought unlikely to attend while in diplomatic limbo.