Eastern Europe's two most independent Communist states, Yugoslavia and Romania, have both warmly welcomed the U.S. decision to establish full diplomatic relations with Peking.

Western diplomats believe that hlavish praise by the two Balkan countries for last week's Sino-American agreement reflects their common belief that the emergence of China as a new force in world politics can only serve to strengthen their own independence from the Soviet Union.

The leaders of both countries have frequently spoken of the need for an end to an international system in which the world is divided into two spheres of influence dominated by the Soviet Union and the Union States.

Offiecial commentaries released in Yugoslavia and Romania have stressed that the U.S. decision has described by Yugoslavia as "a contribution of peaceful coexistence between nations" and by Romania as "an outstanding event in the service of peace."

Both countries drew Soviet criticism last August for inviting Chinese Chairman Hua Kuo-feng to visit the Balkans-a part of the world traditionally regarded by the Kremlins as its own backyard. In playing host to Hua, both Yugoslavia's President Tito and Romania's President Nicolae Ceausescu were in effect publicly demonstrating the limits to Soviet power in Eastern Europe.

Like President Carter, both Tito and Ceausescu have gone to considerable lengths to emphasize that their ties with China are not directed against any third country-by which they mean the Soviet Union. The fact remains, however, that the new Chinese connection is having a profound and continuing effect on their relations with Moscow.

A different attitude toward relations with China was one of the main reasons for Ceausescu's public defiance of the Soviet Union at last month's Warsaw Pact summit in Moscow. In the knowledge that his stand would be supported by Peking, the Romanian leader refused to agree to a Soviet proposal to increase defense budgets and accept greater Soviet control over his armed forces.

In Yugoslavia, which was the first Communist country to break away from the Soviet bloc, friendship with China is regarded as a kind of additional insurance policy against possible Soviet interference after Tito's death.

An offical Yugoslav commentary on the Sino-American agreement said it marked "the end of a period of isolation of the People's Republic of China" and added: "This large country accounting for nearly one quarter of mankind has at last gained the necessary conditions to participate in world affairs on an equal footing."

The Romanian news agency Agerpres said the event would aid detente and also help toward the conclusion of a new U.S.-Soviet strategic arms limitation agreement.