Soviet troops begin pulling out of Afghanistan in 30 days under an international pact signed here to end their 8-year-old intervention in that war-ravaged country. Prospects for Afghan peace remained dim, however.

The Soviet Union, United States, Pakistan and Afghanistan signed the international accord during a brief ceremony Thursday in Geneva's United Nations building, where U.N.-mediated peace talks began six years ago.In Moscow Friday, the Soviets accused the United States of trying to ruin the agreement by continuing to supply weapons to the Moslem rebels fighting the Kabul government.

"Washington is confirming its policy of neoglobalism, a course of export of counterrevolution," the Tass news agency said in the first official Soviet press commentary issued since the signing of the pact.

Tass said the United States was insisting the Soviet Union stop its military aid to Afghanistan's Marxist government.

The United States and Soviet Union both reserved the right to continue providing military assistance to the warring sides.

"History has been made today," U.S. Secretary of State George P. Shultz said at a news conference following the signing of the accords, which go into effect May 15.

The deposed king of Afghanistan, Mo-hammad Zaher Shah, proposed convening a "loya jitga," or grand assembly of Afghan tribal leaders, to try to set up a transitional government.

Zaher Shah made the comment Thursday in Italy, where he has lived since being dethroned in 1973. He has been mentioned by various parties as possibly returning to play a role in an interim government.

Friday, the U.N. High Commissioner for Refugees urged the safe and voluntary return of the more than 5 million Afghan refugees who have fled to Pakistan and Iran.

The United Nations expects to spend hundreds of millions of dollars supervising the return, the largest repatriation effort ever. U.N. officials will present a detailed first-year plan within 10 days, refugee commissioner Jean-Pierre Hocke told a news conference.

In addition to providing for the Soviet troop pullout, the accord also pledges non-interference by Pakistan and Afghanistan in each other's affairs.

Shultz said the withdrawal of Soviet forces from Afghanistan, where they have been supporting the Marxist government of President Najib against Moslem rebels since December 1979, would remove the cause of the "brutal war."

Soviet Foreign Minister Eduard Shevardnadze told a separate news conference that the agreements "put an end to outside interference in Afghanistan's affairs and make it possible for the Afghan people to establish peace and harmony in their land."

Others disagreed.

In Islamabad, Pakistan President Zia ul-Haq said: "I see trouble and turmoil in Afghanistan through the insurgency, through the Mujahedeen (guerrillas) trying to achieve their objective to overthrow this regime and establish their own authority."

He said, "That will mean more loss of life."

The guerrillas' seven-party alliance rejected the Geneva accords and vowed to keep fighting to topple the Kabul government.