ROME (AP) _ Pope John Paul II and Rome's leading rabbi embraced, read from the Psalms and prayed together in silence Sunday during the first recorded visit by a pope to a synagogue.

John Paul deplored the ''hatred and persecution'' of the Jews throughout the centuries.

''You are our dearly beloved brothers and, in a certain way, it could be said that you are our elder brothers,'' John Paul said to resounding applause from the crowd of about 1,000 people.

Speaking in Rome's monumental main synagogue facing the Tiber River, spiritual center of what is believed to be the oldest Jewish community in the West, the pope pledged the Roman Catholic Church would further its efforts to remove all forms of prejudice.

But John Paul did not address the thorny issue of Vatican refusal to establish diplomatic relations with Israel.

John Paul and Rome's chief rabbi, Elio Toaff, sat in gold-trimmed upholstered chairs at the head of the synagogue, facing the congregation. They entered the synagogue to the accompaniment of a choir singing a Psalm.

The pope wore a white skull cap and cassock, decorated by a gold cross. Toaff also wore a white gown, with a stole striped in black.

After readings in Hebrew, which were translated into Italian, Giacomo Saban, the president of Rome's Jewish community, spoke first.

He said that in the 16th century copies of the Talmud, a collection of Jewish writings, were burned in Campo dei Fiori, a square a short distance from the synagogue.

Shortly afterward, Saban said, in 1555, Pope Paul IV ordered the city's Jews confined in the ghetto, which existed until 1870 and is the site of the present synagogue.

Saban then declared that Israel is ''central to the heart of every Jew,'' and expressed the hope that ''any reticence in regard to the State of Israel'' will be removed.

The pope, speaking in Italian, said: ''Certainly, we cannot and should not forget that the historical circumstances of the past were very different from those that have laboriously matured over the centuries.''

He quoted from Second Vatican Council's revolutionary 1965 document on non- Christian religions, ''Nostra Aetate'' (In Our Times), which officially rescinded the accusation that the Jews killed Christ.

That document was considered a turning point in Catholic-Jewish relations.

Quoting from the document, John Paul said the church ''deplores the hatred, persecutions, and displays of anti-Semitism directed against the Jews at any time and by anyone.''

''I repeat: 'by anyone.'''

''I would like once more to express a word of abhorrence for the genocide decreed against the Jewish people during the last war, which led to the Holocaust of millions of innocent victims,'' John Paul said. He recalled his visit to the Auschwitz concentration camp in his native Poland in 1979.

''The Jewish community of Rome, too, paid a high price in blood,'' John Paul said. A plaque outside the synagogue is dedicated to the memory of 2,091 Roman Jews deported by the Nazis.

John Paul said it was a ''significant gesture'' that church buildings in Rome and the Vatican were opened to give refuge to ''so many Jews of Rome being hunted by the persecutors.''

The pope drew applause when he ended his speech by reciting a Psalm in Hebrew.

Toaff called the visit, which began at 5 p.m. and lasted an hour and 20 minutes, a ''gesture destined to pass into history.''

Vatican officials have stressed the ''religious nature'' of the pope's visit and said that it did not have political overtones.

Italian newspapers reported that on the eve of the papal visit, Arab ambassadors in Italy issued a joint statement that the visit should not be interpreted ''as an identification of Judaism with Israel.''

The Vatican has never formally explained why it has not established diplomatic relations with Israel, but Vatican officials have indicated the disputed borders and the lack of peace in the Middle East are holding up recognition.

The Vatican does not have formal ties with Jordan, which lost its West Bank to Israel in the 1967 Arab-Israeli War.

Italian officials mounted a massive security operation for the visit, using more than 3,000 policemen and banning cars from the area.

Arab terrorists attacked the synagogue in October 1982, killing a 2-year- old boy and wounding 36 people. The Jewish community expressed anger at the pope then for meeting with Yasser Arafat, chairman of the Palestine Liberation Organization, a month earlier.