The Polish government today announced that the Soviet Union has granted a "badly needed" major loan to stabilize the country's shaky economy. Earlier in the day, the government signed a formal agreement with leaders of more 300,000 striking mine workers in southern Poland.

The announcement of the loan from Moscow and aid from other Soviet Bloc nations came after the end of three weeks of strikes along the Baltic Coast and in Silesia, Poland's industrial heartland. Today's developments signal a new phase in the country's most sweeping labor upheaval in more than a decade.

The timing of the announcement appears to indicate that the Polish leadership under Communist Party chief Edward Gierek still enjoys the confidence of the Kremlin, despite Warsaw's agreements with the striking workers to permit the establishment of the independent trade unions. The agreements are unprecedented within the communist world.

The Soviet have come to Poland's financial aid at times of serious labor crisis in the past. In November 1976, Moscow was reported to have provided considerable financial help as well as deliveries of grain, raw materials and consumer goods.

The swiftness of the Polish announcement today is significant because it follows widespread speculation in the Western press of Soviet unhappiness with the terms of the agreement reached with the strikers along the Baltic Coast. Moscow has traditionally looked with sharp disfavor on any indication that groups outside the Communist Party structure were gaining power within its satellite states.

The news agency PAP said Moscow had issued a hard-currency loan for the purchase of the vital raw materials for the country's light chemical and steel industries. The agency also said food supplies from East Germany, Czechoslovakia, Hungary, Bulgaria and Romania would be delivered faster.

PAP did not give details of the Soviet loan, which Moscow has not yet confirmed, but the agency indicated it was a major boost for the country's economy, which was shaky even before the huge losses resulting from the current unrest.

First Deputy Premier Mieczyslaw Jagielski, who negotiated labor peace in the Baltic ports last week, was quoted by PAP as saying the Soviet Bloc help come just in time.

"Their help is badly needed by us," Jagielski said.

Communist authorities have now settled with the nation's three most important groups of industrial workers shipyard and steel workers, and miners. Interest now centers on how these agreements, particularly the one allowing independent trade unions, will operate in practice.

In a move seen as backing promises of economic reform, the government today announced that the State Price Committee will take over the fixing of prices for meat and 45 other basic food items, for consumer goods such as a shoes and toothpaste and for rents and public transport fares.

"The announcement, in the Warsaw daily Zycie Warszawy and on television, seemed to be a step toward ending the power of service industries and major enterprises to raise prices for their goods and services. Worker complaints about increases in the cost of living and spurred the strike movement.

Meanwhile, the Polish parliament, the Sejm, has been convened for a special session Friday to begin drafting new legislation on the basis of the new labor agreements. Apart from new trade union legislation, new bills will be introduced limiting censorship, raising wages and improving living conditions, and lowering retirement age.

The Communist Party Central Committee, the country's supreme policymaking body, is due to meet soon to analyze the causes of the crisis and to draft a program of reforms.

A government commission headed by Deputy Premier Alexander Kopec succeeded in its efforts to get the miners back to work by conducting final negotiations into the dawn hours today. At strike headquarters at Jastrzebie, just a few miles from the Czechoslovak border, there was little of the tense uncertainty that characterized the negotiations at the Lenin Shipyard in Gdansk on behalf of 600,000 Baltic Coast workers over the previous two weeks.

Kopec surprised the miners by swifting giving into virtually all of their demands. The sole difficulty came over a demand for Saturday off, which the government was reluctant to concede, but finally did.

Plebiscites will be held in the 60 or so mines throughout Silesia to decide whether to abandon an unpopular shift system introduced last year and aimed at ensuring a continuous 24-hour operation at the coal face. Miners criticized the system as distruptive of family life and a factor in the recent space of mine accidents in Silesia.

During the negotiations, a black cloth was hung up in the conference room in mourning for eight miners killed in an accident on Monday.

Despite the government to return to work, which is expected to resume Thursday, dissidents in Warsaw reported that several mines were continuing with the strike since they had not received assurances that they were formally included. But government officials denied all knowledge of this and it seemed likely that work would resume.

Meanwhile, the Polish press continued to defend the establishment of new trade unions as "a significant strengthening of socialist democracy." Many of the commentaries appeared at least partially aimed at reasuring the Soviet Union that, despite earlier warnings, "antisocialist elements" failed to gain the upper hand during the strikes.

The Warsaw daily Zycie Warszawy said the strikes had taught the leadership a valuable lesson, reminding them that "listening to the voice of the people" was a basic law of socialism.

"The recent conflicts have thoroughly exposed the fatal effects of departing from this principle. The will of the party to listen to the people had declined," the paper said.

Government officials have said that the agreements reached in Gdansk and Szczecin will apply nationwide. A conference of regional party bosses was held in Warsaw yesterday to discuss implementation of the reforms.

One of the key issues is the relationship between the new, independent trade unions and the new, independent trade unions and the old, official ones. With more and more workers lining up to join the new unions, there is a very real possibility that the official unions will be left with a topheavy bureaucracy but very few members.

To compete with the new independent unions; the official unions will be forced to be much more forthright in their defense of workers' interests. The newly appointed trade union head, Romuald Jankowski, has already called for the "deep renewal" of the trade union movement and the holding of free elections by secret ballot.

In practice, however, in areas where there have been wide-scale strikes, the official unions could be left with little real influence. It is difficult to see how they will operate in a situation where a vast majority of the workers support the newly established independent unions.

Even in those regions where labor unrest has been relatively muted, interest in the new unions has been high. Discussions about the agreements reached in Gdansk and Szczecin have been held in factories throughout the country.

The concern of workers that they should not be left out of the new agreements was reflected by a strike today in a heavy engineering plant in Warsaw. The workers downed tools in protest at an article in the local press that suggested they were not interested in setting up independent unions of their own.