WARSAW, AUG. 27 -- The burning and looting of the headquarters of Bulgaria's ruling Socialist Party in Sofia Sunday night is an appropriately grim symbol for a stumbling and near-bankrupt government that has emerged as the weakest in Eastern Europe.

The incident, the most serious street violence in Bulgaria since the overthrow of Communist leader Todor Zhivkov last November, wasstarted by demonstrators protesting the continued presence of a huge illuminated red star atop the party headquarters, the largest building in the Bulgarian capital.

The Bulgarian parliament had yet to remove the star after they voted earlier this month to "liquidate" symbols of the Communist past. In an apparent effort to head off more violence today, hundreds of riot police surrounded the party building.

Prime Minister Andrei Lukanov told reporters this afternoon that police had been ill-prepared to stop or control Sunday's violence, during which looters entered the building and fled with computers, files, furniture, cases of liquor and at least one large smoked ham.

{A Sofia police official said today that 39 people were arrested in the incident and at least 17 injured, including two policemen. The official said also that most of those taken into custody had criminal records, the Associated Press reported.}

Beyond the physical damage, the attack on the building seems to punctuate a rapid political deterioration for a party that won a resounding democratic mandate just two months ago. Then, voters bucked anti-communist fashion in Eastern Europe and handed the Socialist Party -- the renamed former Communist Party -- a ruling majority in parliament.

Yet, from the day the party announced its victory in a vote that was generally regarded as free and fair, it has demonstrated an inability to cure or even address Bulgaria's deep-seated economic ills.

The long list of troubles includes severe shortages of sugar, cooking oil and detergents. The government cannot make payments on its $10.6 billion foreign debt and has been denied a crucial oil subsidy by the Soviets. The United Nations trade embargo against Iraq ended an oil-for-old-debts arrangement that was the government's best hope for keeping the country's gas stations open.

Opinion polls reflect the failure of the Socialists to hold on to the support they were able to marshal in the June elections. By mid-August, polls showed that the opposition Union of Democratic Forces, which took 38 percent of the June vote, had the support of 57 percent of those surveyed.

Besides losing the backing of the Bulgarian people, the Socialist government has also failed to win the trust of Western investors and donor countries. Western diplomats and businessmen say they doubt the government's commitment to political and economic reform. As countries like Poland and Hungary race each other to privatize government-dominated economies, there is strong evidence in Bulgaria that the Socialists interpreted their electoral victory as a signal that the system need not change rapidly.

The so-called "free-market" reforms outlined by the Socialist government appear to keep the government and the party in control of the economy. Western economists say the proposed measures fail to allow market forces to dictate prices or currency values.

The only workable option for Bulgaria, Lukanov has said frequently, is for the Union of Democratic Forces to join with the Socialists in a coalition government. The UDF, thus far, has refused. Its leaders say they would prefer that the Socialist government collapse and that new elections be held to choose a "non-communist" reform government.

Today, opposition leaders denounced Sunday's violence and described the demonstrators as extremists. Newly elected President Zhelyu Zhelev, a former opposition leader, said in a radio broadcast that the rioters "are serving and acting to the benefit of the most perverted and dark forces in our society. They are people who want a new dictatorship."

Zhelev, a compromise choice for president, was elected by parliament only after weeks of delay and six inconclusive votes in the Socialist-controlled body, a process that seems to reflect the stasis afflicting the present government. In recent interviews, Zhelev and other politicians have agreed that the future for Bulgaria, as the country heads into a winter of food and fuel shortages, is bleak.