WARSAW, Poland - Lech Walesa, the founder of the Solidarity union, which helped topple communist rule in Poland, lashed out at the country's president in remarks published yesterday, angry that the president accused him of having spied for the communist-era secret police.

No one symbolizes the struggle against Eastern European communism better than Walesa. For agitating against the regime, the electrician was fired from his shipyard job, thrown in jail, and prevented from attending his own Nobel Peace Prize ceremony.

But that legacy has never shielded him from accusations that he spied for the secret police, an accusation Polish President Lech Kaczynski voiced again this week in remarks to the Polish news agency PAP - and which Walesa, for the umpteenth time, rejected as a lie.

In a statement published in Polish newspapers yesterday, Walesa denounced Kaczynski's accusation as absurd. He said he was "embarrassed before the world" that the president of "the country of Solidarity's victory" would accuse him of having collaborated with the hated secret police.

Kaczynski accused the renowned dissident in a televised interview Wednesday of having been a secret agent for the very regime that he opposed publicly in the 1970s and 1980s.

Kaczynski's remarks came in response to questions about a book on Walesa that is to be published this summer. In the book, two historians raise the old allegation that Walesa operated as a secret agent under the code name "Bolek."

Walesa was cleared of that allegation by a court in 2000, but the accusations continue to surface periodically in public discussions.

Asked if he believed that Walesa was indeed "Bolek," Kaczynski said "yes," and that he supported the publishing of the new book.

"A democratic society has the right to know the truth, even if it is difficult," Kaczynski said in the interview, broadcast on Polsat, one of the most widely viewed stations in Poland. The president's Web site also carried a transcript of the interview.

As a young electrician at the Gdansk shipyard, Walesa founded the pro-democracy Solidarity trade union, becoming a symbol in the battle against the communist regime.

Walesa was arrested in 1981 and locked away during a harsh military crackdown. But he eventually helped guide the overthrow of communism, and went on to become the first president in a democratic Poland, from 1990-95.

New controversy has arisen about Walesa's past as the country awaits the publication of the book, which the authors say will include fresh evidence about Walesa's contact with the secret police in the 1970s.

Although Kaczynski acknowledged not having read the book yet, he said: "I myself know the truth, regardless of the material in the book."

Kaczynski became politically active when he joined the anticommunist opposition in the 1970s; in the 1980s he served as an adviser to the Solidarity movement.

After the fall of communism, he served briefly as an adviser to Walesa during his presidency but later fell out with him. The two frequently express their dislike for each other publicly.