MOSCOW, JAN. 3 -- President Mikhail Gorbachev reached a provisional agreement with the Soviet Union's squabbling republics today on funding the federal budget in the coming year and on urgent economic stabilization measures.

The agreement represents a significant political success for the embattled Soviet leader, who had warned that failure to agree on a budget for 1991 would mean the end of the Soviet Union. It also reduces, for the time being at least, the risk of a showdown between the central authorities in Moscow and the giant Russian republic led by Boris Yeltsin, Gorbachev's chief political rival.

Russia, by far the largest and wealthiest of the 15 Soviet republics, initially had sought to slash its contribution to the central budget by more than 80 percent -- to 23.4 billion rubles.

Another confrontation, meanwhile, is shaping up in the Soviet Baltic republics, where pro-Moscow Communist Party officials have called out riot police to seize several key buildings from the new nationalist governments.

The Soviet news agency Tass said an agreement on "stabilizing the social and economic situation in the country" had been approved at a meeting of the Federation Council, attended by Gorbachev and representatives of all the Soviet republics. Under constitutional changes approved last month, the Federation Council, which was formally a presidential advisory body, is now responsible for deciding important policy matters involving the interests of the republics and the central government.

In an interview with Soviet television tonight, Gorbachev hailed the agreement as a step toward a new Treaty of the Union on the division of political and economic power in a reshaped Soviet federation. "The results of our work show convincingly that we will be able to take control of the situation," said Gorbachev, adding that months had been lost in a "tug-of-war between the center and the republics."

The provisional accord on the 1991 budget marks the second time in five days that Soviet leaders have retreated from the brink of political confrontation at the last moment. Last weekend, the legislature of the small Soviet republic of Moldavia agreed to a series of demands by Gorbachev on measures to ease tension between the ethnic-Romanian majority and the Russian and Turkic minorities.

Last month's session of the Congress of People's Deputies, the country's highest elective governing body, voted Gorbachev extraordinary constitutional powers to enable him to deal with the country's deepening political and economic crisis. Liberal members of the Congress expressed fears that the country was witnessing a return to authoritarian rule, but the Soviet leader has so far used his powers as a threat rather than an instrument of political repression.

In the Baltics, meanwhile, elite Interior Ministry troops, known as the "black berets," this week took control of a huge printing plant in the Latvian capital, Riga, and two Communist Party buildings in the Lithuanian capital, Vilnius.

Most Latvian newspapers failed to appear today following a general strike by journalists and printers to protest the occupation of the printing plant. In an attempt to ease tension, Latvian President Anatolijs Gorbunovs met in Moscow today with senior Soviet officials, including Chief of Staff Gen. Mikhail Moiseyev. Gorbunovs described the talks as "encouraging" but did not go into details.

{In Washington, the State Department criticized the seizures as provocative acts that could exacerbate tensions. Spokesman Richard Boucher said it was not clear if the actions were initiated locally or on instructions from Moscow. In any case, Boucher added, the United States considers that ultimate responsibility for the seizures rests with the Soviet government.}

Russian Information Minister Mikhail Poltoranin said tonight that both the Kremlin and the Russian republic had made some "concessions" during protracted bargaining on the terms of the 1991 budget over the New Year holidays. He said Russia had agreed to increase its contribution to Soviet military expenditures and had dropped its objections to Soviet authorities taking a portion of a turnover tax on businesses.

Details of today's compromise agreement were not disclosed, but the outline seems clear. Russia and the other republics have agreed to increase their planned contributions to the budget in return for tighter controls over the way the money is to be spent.

Addressing the closing session of last month's Congress, Gorbachev had accused Russian leaders of pursuing a policy of "every man for himself" by rejecting the central government's proposals for the 1991 budget.

In a telephone interview, Poltoranin said this week's negotiations had helped eliminate considerable overlapping between the Soviet and Russian budgets. He said Russia was not opposed in principle to contributing funds to the central government but wanted to ensure that the money would not be wasted.

Gorbachev had set a deadline of Jan. 10 for reaching a temporary economic agreement, pending conclusion of a new union treaty to replace the outdated 1922 treaty establishing the Soviet Union. He said failure to reach agreement on the budget would have plunged the country into economic chaos, forcing the central government to default on salaries, pensions and scientific research allocations.

Gorbachev told television news that detailed proposals for the reorganization of the central government would be submitted to the Soviet standing legislature, or Supreme Soviet, next week after first being considered by the Federation Council. He said newly appointed Vice President Gennady Yanayev would chair a committee drawing up proposals for the reorganization.