MOSCOW, DEC. 27 -- President Mikhail Gorbachev persuaded Soviet legislators today to accept his unpopular choice for vice president and then embarked on a new political trial of strength with the giant Russian republic over the right to control its economic resources.

The looming confrontation with the largest and wealthiest of the Soviet Union's 15 republics overshadowed a temporary political setback for Gorbachev at the closing session the Congress of People's Deputies, the supreme Soviet legislative authority. It required two ballots and a personal appeal from the Soviet leader to persuade the Congress to endorse his choice of Gennady Yanayev, a colorless Communist Party apparatchik, as the country's first vice president.

Yanayev, 53, who rose to power through the Communist youth league and the official trade unions, was 31 votes short of the necessary overall majority of 1,120 votes on the first ballot but won comfortably on the second, 1,237 to 563.

Even some Communist members of the Congress appear to have had initial reservations about Yanayev, feeling that he had too little direct experience in running the economy or dealing with the republics.

Gorbachev's difficulties in getting his protege elected vice president may prove trivial, however, in comparison with the political struggle shaping up with Russian President Boris Yeltsin, the country's most popular politician. Gorbachev took the floor twice today to warn of political and economic catastrophe if the Russian legislature continues to defy the central government.

"If we allow ourselves to continue with these endless debates, we will lose two or three months. Everything will be destroyed, and the people will come out onto the streets," Gorbachev declared.

The immediate cause of the latest row between Gorbachev and Yeltsin is the Russian legislature's decision to slash contributions to the Soviet treasury next year by about 80 percent. But the larger issue is the unresolved dispute of who controls Russia's vast natural resources, particularly its strategic reserves of oil, gas, gold and diamonds, a dispute that raises questions about the nature of the Soviet Union itself.

This summer, the Russian legislature adopted a declaration of sovereignty, asserting the supremacy of its own laws and its right to dispose of all economic resources on Russian territory. Every other republic has followed suit, triggering a "war of laws" between the Soviet and the republics' legislatures.

Gorbachev called today on Russia to sign a temporary agreement covering the first three months of 1991 to prevent the country's economy from grinding to a halt before negotiation of a new Treaty of the Union redefining the power balance between the central government and the constituent Soviet republics. He also made clear that he is prepared to use his newly acquired executive powers to ensure that the Russian legislature complies with federal budget regulations.

"If we do not take this path, it will be more than just a 'war of laws.' It will be the collapse not only of the economy, but of the country itself," Gorbachev said.

Yeltsin, who has accused Gorbachev of amassing greater legal power than any previous Soviet leader, failed to attend today's closing session of the Congress. Instead, in a gesture that seemed designed to underline his determination to defend Russia's sovereignty, he flew to the resource-rich Yakuta region of Siberia for talks with local officials.

The Congress adopted a resolution setting a Jan. 10 deadline for Gorbachev and the republics' leaders to reach an agreement on how to divide economic resources for 1991. The standing Soviet legislature, or Supreme Soviet, is due to reconvene Jan. 8 to approve the appointment of a new, streamlined government under Gorbachev's personal authority.

Meeting for the fourth time since partially free elections in May 1989, the Congress seemed to confirm a sharply conservative shift in Soviet politics that has been evident over the past few weeks. Membership in the radical-reformist Inter-Regional Group has dwindled to 229, compared to 561 in the conservative Soyuz faction, according to registration figures released this week. The mainstream Communist group led by Yanayev had 730 members.

With the Congress clearly disposed to grant Gorbachev all the extra powers he demanded, the locus of political opposition to the president has shifted to the legislatures of the republics, and particularly to the Russian legislature. Today's debate suggested that Gorbachev feels the time has come to reassert the primacy of the central government.

The president said that if other republics followed Russia's example and cut their contributions toward meeting the country's 250 billion ruble deficit, the central government would be forced to disband the armed forces and stop basic scientific research. "That's not serious," Gorbachev said, noting that the Russian legislature wants to keep 100 percent of a value-added tax on enterprises in the Russian republic.

A senior Russian economist, Mikhail Bocharov, said Russia has been obliged to assert its sovereignty to prevent the massive depletion of its natural resources. "Nobody is saying that we should not contribute to the federal budget -- but we must know how the money is to be spent," he said.

Yeltsin's hopes of putting Russia in the vanguard of economic reform have been dealt a serious blow by the collapse of the "500-Day Plan" for a rapid transition to a market economy that was adopted by the Russian legislature this year. One of the principal authors of the program, Russian Finance Minister Boris Fyodorov, resigned this week, saying little progress was being made because of the "incompetence" of the republic's government.

"The activity of the {Russian} government is permeated with populism, a desire to please everybody. We are constantly distributing money and privileges, a process that will lead simply to the bankruptcy of Russia," said Fyodorov, whose calls for stringent monetary controls won him considerable respect among Western bankers.

Another of the authors of the 500-day program, Grigory Yavlinsky, resigned as Russia's deputy prime minister two months ago, arguing that it was impossible to implement the plan without the support of the central government.

Yanayev, in his first news conference since his election as vice president, denounced what he described as the "legal bacchanalia" in the Soviet Union, which he described as the result of a "paralysis of political power." He said his main task as vice president would be to carry out the orders of the president.