Knocked out of the presidential race by a political upstart, a shocked Prime Minister Tadeusz Mazowiecki has resigned along with the rest of Eastern Europe's first non-communist government.

Solidarity leader Lech Walesa took two-fifths of the vote in Sunday's presidential election and will face a man unknown to the electorate until last month, emigre businessman Stanislaw Tyminski, in a Dec. 9 runoff.The crushing defeat of Mazowiecki - hailed as a hero when he took office in August 1989, capping Solidarity's 9-year campaign to dump the Communists - showed how deeply many Poles have been hurt by a crash economic reform program.

"Poland's painful but necessary program of getting out of economic catastrophe can only be realized with the understanding of the majority of the nation," Mazowiecki said in announcing his resignation.

"Society made its choice."

Mazowiecki said his government will continue in a caretaker role until a new one is formed by the president elected in the runoff.

Commentators said they had underestimated the depth of public unhappiness with Western-prescribed reforms begun under Mazowiecki. They said they also misread the credulity of the public, which was voting in Poland's first democratic election for president.

A radical economic restructuring plan, backed by both Walesa and Mazowiecki, has caused real wages to plummet 35 percent. Unemployment climbed from almost zero at the start of 1990 to more than 1 million today.

Tyminski, who left Poland 21 years ago and returned in September as a successful businessman, articulated the rage felt by many ordinary Poles. He also promised a quick fix.

"I want to make this country rich and prosperous," he said Monday. "It will be better within a month."

Piotr Pacewicz wrote in Monday's editions of Gazeta Wyborcza, a pro-Mazowiecki newpaper, that Tyminski found support in a "second Poland" populated by people alienated by the country's existing political forces.

"In Tyminski, this `second Poland' found a man who embodied their hostility to the Solidarity state, someone clean, coming from outside the alignment in which Communist memories are blending with the hardship of radical reform."

Walesa told reporters he had sensed a growing anger and feared it would be exploited by "a third force." He said that's why he launched his campaign to push for even quicker economic reforms.

But Mazowiecki's camp blamed Walesa for creating an atmosphere in which unreasonable promises were made to a public eager for change.

*****

(Additional information)

Emigre piques Peruvians

Polish presidential candidate Stanislaw Tyminski is a controversial figure in Peru.

Tyminsky is raising as much political emotion in one of his two adopted countries as he is in his native land.

An attorney for Tyminski, Javier Valle Riestra, on Monday denied an accusation by legislators that his businessman client had amassed a fortune illegally.

On Friday a congressional committee accused Tyminski, who holds Peruvian and Canadian passports, of pirating Brazilian and Colombian television broadcasts for his cable television station in Iquitos, an Amazon port 600 miles northeast of Lima.

Valle Riestra told United Press International that both the Supreme Court and the Tribunal of Constitutional Guarantees said in two separate rulings that Tyminski's business activities were "absolutely legal."

He said the accusation was originally brought in a suit by movie theater owners in the tropical city of Iquitos. The TV station is owned by him and his second wife, Graciela Perez Velasco.

According to Valle Riestra, the courts held that Tyminski's operation "did not signify illegal competition under freedom for industry."