WARSAW, Poland - Poland's president celebrated the start of Hanukkah by visiting Warsaw's main synagogue yesterday, a gesture that the city's Jewish community greeted as a historic step in its revival.

Lech Kaczynski's visit marked the first time the head of state has attended a religious service at a synagogue in Poland, whose Jewish population was nearly wiped out in the Holocaust and later suffered from communist-era repression.

The visit "means we're in a normal country . . . a country that treasures that it has citizens of different religions and of different backgrounds," said Poland's chief rabbi, Michael Schudrich.

As Kaczynski entered Warsaw's century-old Nozyk synagogue just after sundown, the congregation rose and a group of Jewish children sang "Shalom Aleichem" - "peace be upon you."

Wearing a yarmulke, Kaczynski strode to the front of the synagogue, where he sat as a choir sang the Polish national anthem and a song in Yiddish - the language spoken by many of the nearly 3.5 million Jews who lived in Poland before World War II.

Poland was a haven for Jews for nearly 1,000 years, and was home to Europe's largest community before the war. Most were killed in the ghettos and death camps that Nazi Germany set up after it invaded Poland in 1939, at the war's start.

In the nearly 20 years since communism fell, the community has enjoyed new vitality, with Jews returning to their roots and shaking off old fears of anti-Semitism.

A prayer for the Polish nation, written for the occasion of the president's visit, was also read.

Kaczynski then lit a cream-colored candle that was placed on a silver menorah.

Piotr Kadlcik, the head of the country's Jewish community, said a pre-World War II president, Ignacy Moscicki, visited a synagogue in the 1920s - but that was not for a religious ceremony and he did not spend time with the congregation.

Kaczynski, who is Roman Catholic, has long been a friend to the Jewish community.

He visited the synagogue in his former role as mayor of Warsaw; he promoted a planned museum on Jewish history by donating city land to the project; and for the past two years he has marked Hanukkah with candle-lighting celebrations at the presidential palace.

But his appearance in the house of worship - amid those who had survived the Holocaust and children with no memory of it - was greeted as even more meaningful.

"This time the president came to visit us," said Rabbi Mati Pawlak, the first native Pole to serve as a rabbi in Poland since the fall of communism. "It shows that relations are getting closer."