WARSAW, JULY 5 -- A personal power struggle is undermining economic reform in Poland and sullying the Solidarity-led government's image as the most stable reformer in Eastern Europe.

Bankrupt farmers are threatening nationwide roadblocks. The World Bank is beginning to grumble about delays in the implementation of economic changes. Solidarity's control of parliament is coming unglued, and public confidence that the moribund economy will ever improve is fast disappearing.

Behind it all is the irrepressible, seemingly ubiquitous figure of Lech Walesa. Nearly every day, the mustachioed labor union leader flexes his populist muscles, accuses the government of coddling former Communists, claims that workers are being betrayed and insists that he be made president. From that pulpit, Walesa said recently, he would swing a "sharp ax" and personally overrule the democratic process "wherever flaws appear."

In an attempt to revive the government's image and defang Walesa's growing challenge, Prime Minister Tadeusz Mazowiecki has announced that on Friday he will order a major government shake-up.

Mazowiecki was handpicked for his job by Walesa last fall, but in recent months the two men, who were longtime friends, have become rivals. Walesa accuses Mazowiecki of creating "a dump of bureaucracy" in Warsaw. Mazowiecki, in turn, says he will never "pay homage" to his "lord."

The firings expected on Friday, the first changes in the cabinet since the government was formed nine months ago, are expected to bring an abrupt end to a power-sharing deal in which Communists last year were guaranteed control of the country's police and army.

The shake-up apparently is intended to show the public that Mazowiecki is not, as Walesa charges, soft on former Communists.

According to a senior leader in parliament, the most prominent cabinet member to be dismissed will be the interior minister, Gen. Czeslaw Kiszczak. Many Poles identify Kiszczak as the principal henchman in the Communists' crackdown on the Solidarity movement during most of the 1980s.

As many as 10 other ministers, including a former Communist in charge of the Defense Ministry, are expected to be dismissed. Anticipating the shake-up, Agriculture Minister Czeslaw Janicki, a former member of a Communist-allied puppet party, resigned today.

Besides the cabinet shake-up, two influential Solidarity leaders said in interviews this week that a national presidential election is now likely this fall. Until recently, Mazowiecki and his confidants had insisted that such an election would have to wait until at least next year. It is widely believed that Walesa would win such an election.

A hurried-up presidential election is needed, these leaders said, because Walesa has succeeded in undermining the legitimacy of the government.

By acknowledging this, the government appears to be conceding that Walesa is a one-man political institution whose populist power cannot be overcome. Rather than fight him, the idea seems to be to embrace him as president.

"After one year, a time of accounting has come," said Adam Michnik, editor of the Solidarity daily newspaper. "We must ask if the continuation of economic reform is not now demanding a new legitimization of the government. This would mean new elections."

"It now looks like an election will have to take place in the fall," said Henryk Wujec, a member of parliament and the deputy leader of the Solidarity caucus. "That is the only way of resolving these crucial problems."

For such an election to take place, the current president, Wojciech Jaruzelski, would have to resign. Jaruzelski, the army general who imposed martial law here and ordered the arrest of many of the people who now run Poland, holds his position as part of the power-sharing arrangement agreed to last year by Solidarity and the outgoing Communists.

An embrace of Walesa, if it occurs, is likely to be done reluctantly, for the former shipyard electrician has angered and insulted many of his Solidarity colleagues. Both Wujec and Michnik, for example, received telefax messages from Walesa telling them that he no longer considered their services valuable to Solidarity.

Leaders in the government have charged that Walesa is destabilizing Poland as he pursues his personal ambitions. They say he has raised worker expectations to unrealistic levels.

In doing so, they say, he is sabotaging the country's economic reform program, which is the most far-reaching in Eastern Europe. Western economists say that after four decades of Communist mismanagement it will take years to repair Poland's shattered economy. For this rebuilding to succeed, they say, the government must depend on the public's willingness to endure economic hardship.

"By making promises of quick improvements in the economy, he has created hope among workers that no one knows how to materialize," Wujec said.

Opinion polls show a precipitous decline in the past half-year in the public's confidence that the government is capable of improving the economy. In January, nearly 60 percent of the population felt that living standards would improve in the coming three years. By June, only 34 percent were still optimistic.

Real wages have fallen by nearly 40 percent since January. Strikes and threats of strikes are breaking out across the country. It is from these job actions that Walesa derives his formidable influence over the government.

Last month, Walesa single-handedly negotiated an end to a potentially disastrous nationwide rail strike that the government had been unable to head off.

"The source of his power is his charisma. I have never in my life met a more outstanding leader of union strikes," Michnik said. "But it could become standard that Walesa is going from one city to the next settling strikes. It doesn't bode well for the legal norm and democratic rule."

Michnik described the rift in Solidarity as a division between two political cultures. He said that Walesa and his right-of-center faction of Solidarity, called the Center Alliance, represent a nationalistic, authoritarian and anti-Semitic culture in Poland. He does not, however, accuse Walesa of anti-Semitism.

Walesa often characterizes the government as a ruling clique of "eggheads." A newspaper Walesa controls, Tygodnik Solidarnosc, recently concluded that "real control" in the government "is in the hands of the 'salon,' a caste-like group connected by societal ties and jealously guarding its outstanding position."

This populist, class-oriented criticism infuriates many leaders of the government, and it has broken down Solidarity's traditional alliance between intellectuals and workers.

There is, however, a grain of truth in the criticism, according to a number of observers, who say Mazowiecki has moved far too slowly in ridding the government of Communist holdovers.

"Mazowiecki chose not to put the fear of God into the 2 million nomenklatura of the old regime, but to incorporate them into his government," said Marcin Krol, editor-in-chief of the Respublica publishing house. "By doing this, he won their loyalty and kept the government from paralysis, but he never explained to the public what he was doing."

Krol said many Poles have concluded that the government is a "half-and-half" affair that allows Communists to stay in power. This impression is not really justified, Krol said, but Mazowiecki has failed "to make big speeches explaining what he is doing. His general attitude is that he thinks he is virtuous and that virtue does not need selling."