WARSAW, DEC. 22 -- Lech Walesa, the irrepressible labor union leader whose Solidarity movement routed communism and sparked democratic change across Eastern Europe, was sworn in today as the first popularly elected president in the thousand-year history of Poland.

"The evil period is ending when the authorities of our state were chosen under foreign pressure," said the 47-year-old vocational school graduate, former shipyard electrician and Nobel Peace Prize winner. "Today we are making a fundamental step on the long and bloody road to rebuilding our independence."

But the ceremony included remnants of bitterness from the bruising presidential campaign Walesa waged in the past several months. Among other signs that tensions remain, outgoing Prime Minister Tadeusz Mazowiecki staged a walkout at a symbolic moment during today's event.

In front of both houses of the Polish parliament, Walesa declared that his presidency symbolizes the beginning of a new republic and a definitive break with the Communist past.

Making that point as resonantly as the new president's words was the absence from parliament of outgoing president Wojciech Jaruzelski, the former Communist general who temporarily muzzled the Solidarity movement in 1981 by ordering marital law. He jailed Walesa for 11 months.

Jaruzelski, who served as president for 15 months under a power-sharing deal between Solidarity and the now-defunct Communist Party, was not invited to the swearing-in ceremony. He stayed home and watched it on television.

Walesa addressed the Polish nation as a grayer and notably stouter version of the firebrand with the walrus mustache who a decade ago molded Solidarity into a national force and an international cause.

But at noon today, his carefully trimmed moustache and dark blue suit notwithstanding, he sounded like the Walesa of old, punching out a 10-minute speech in his trademark, machine gun staccato.

"I come from a peasant family, and I have been a worker for many years. I shall never forget where I came from on the way that led me to the highest office in the state," Walesa said.

He promised to run a decentralized government that would allow "as many decisions as possible to be made at the grass-roots level, where people live and know their problems."

As he often does, Walesa mixed salt with his populist sugar. He warned the average Pole to wake up, saying that the biggest obstacles to revitalizing the country are "passivity and apathy."

The new president was elected Dec. 9 after a bruising campaign that split the Solidarity movement, fracturing the unique alliance it formed between intellectuals and workers.

His opponent and longtime friend, Mazowiecki, had accused Walesa of demagoguery, of promising far more to workers than the government could deliver. Walesa said during the campaign that state factories need not close and put Poles out of work until there were jobs available for them in the private sector.

A measure of the bitterness generated by the campaign was Mazowiecki's refusal today to applaud Walesa's speech. When other members of parliament rose for a standing ovation and to sing a traditional Polish song wishing the new president 100 years of life, Mazowiecki and a few colleagues walked from the chamber.

There has been widespread worry among Western governments that Walesa's populist promises could derail Poland's rigorous free-market reforms, which began a year ago and are considered the most successful in Eastern Europe.

The new president went out of his way today to assure the West, on which Poland relies for debt relief, investment and loan credits, that he will stick with the reforms. "{This} program is an example of our stubbornness, of our readiness to take responsibility and even to suffer," he said.

In the past week, however, Walesa's ability to put together a fast-working government has come into question. He admitted Thursday that he was having difficulty finding anyone who wanted to be prime minister. His two first choices backed out after complaining that they did not have a free hand to put together a government.

It became clear in the past week that Walesa was planning to keep outgoing Finance Minister Leszek Balcerowicz in the government. Balcerowicz is the architect of Poland's economic reforms, and his continued presence would send comforting signals to Western governments.

In his speech today, Walesa mentioned Balcerowicz by name, the only such reference to anyone in the outgoing government. The speech supported speculation in the Polish press that Balcerowicz, who says he will stay on only if no one tampers with his program, may be named prime minister.

Walesa suggested this week that if he could not find a prime minister, he would ask Mazowiecki to stay on until spring, when new parliamentary elections are expected. Mazowiecki, whose advisers dismiss the offer as absurd, has not publicly replied.

While Walesa's presidency has caused a split in Solidarity, it has brought home a government-in-exile that has been waiting in London since 1939 for a "legitimate" president. Ryszard Kaczorowski president of the exile government, returned to Poland today for the first time since World War II. At the Royal Castle in Warsaw he gave Walesa an insignia of office and other prewar symbols of power.

"This act symbolizes a marriage of Polish emigres with the homeland," said Walesa, after taking the insignia. "Solidarity has won and this day is a recompense for all of us."