John Paul II, respectfully removing his shoes, today became the first pope to enter a mosque when he toured a 1,300-year-old Islamic house of worship and urged joint forgiveness by Christians and Muslims, whose faiths have warred for centuries over territory and spiritual primacy.

The pope's visit to the Umayyad mosque served as a recognition that the two religions share some ideas and prophets, even as they differ on theological issues such as the divinity of Christ and the nature of the Koran.

John Paul, 80, and Syria's top Muslim cleric, Mufti Ahmed Kuftaro, who is in his late eighties, both used canes as they entered the mosque in Damascus's walled Old City. The pope stopped for a minute of contemplation before a tomb reputedly housing the head of John the Baptist. In deference to Muslim sensitivities, he said no formal prayer inside the worship area.

The pope shook hands with Kuftaro in the building's courtyard, which is ringed by elaborate mosaics depicting heaven and has a minaret where some Muslims believe Jesus will make his second coming.

"For all the times that Muslims and Christians have offended one another, we need to seek forgiveness," the pope said before dozens of Syrian Christian and Islamic leaders and scholars.

No pope had ever stepped into a mosque. During a trip to Jerusalem last year, John Paul did not enter the al-Aqsa mosque, the third-holiest Islamic shrine, when he visited the Noble Sanctuary.

The Umayyad mosque was built in 705 on a site that was once used for pagan sacrifices in honor of the Roman god Jupiter; it later became a Christian basilica. At the peak of the Umayyad caliph's rule from Damascus, it was converted to a mosque, with relics of John the Baptist, known to Muslims as the prophet Yahya, given a central place. A connected courtyard also contains the tomb of Saladin, the Muslim warrior who reconquered Jerusalem from Catholic crusaders.

"It is my ardent hope that Muslim and Christian religious leaders and teachers will present our two great religious communities as communities in respectful dialogue, never more as communities in conflict," the pope said. "It is crucial for the young to be taught the ways of respect and understanding, so that they will not be led to misuse religion itself to promote or justify hatred and violence."

The mosque visit continued the theme of interfaith tolerance the pope struck in Athens on Friday when he asked forgiveness from Eastern Orthodox churches for the schism that split Christianity nearly 1,000 years ago. John Paul is on a six-day, three-country tour that traces the footsteps of the apostle Paul, who converted to Christianity on the road to Damascus.

But the pope has received repeated reminders since arriving in Syria of the tensions still dividing the Middle East. In his speech welcoming the pope Saturday, Syrian President Bashar Assad urged him to support Palestinians in the uprising against Israel and made comments that indicted all Jews for such things as the betrayal of Christ. Vatican officials today reiterated the Roman Catholic Church's rejection of anti-Semitism, and the president of Israel called Assad a racist. Today, as the pope held a three-hour Mass before 40,000 mostly Orthodox observers, fresh fighting erupted in Israel, and Syrian television ran footage showing dead Palestinians.

In their remarks at the mosque, Kuftaro and other Syrian officials said that Zionists were trying to keep Christians and Muslims apart. Kuftaro pleaded for "the Catholic Church all over the world, with his holiness the pope at its head, and the Christian governments of the West to stand in support of justice and put pressure on Israel by every means to curb its atrocious aggression. . . . This is the least that Christianity, as a proof of its allegiance to Jesus Christ, can offer the world."

Despite the controversy surrounding the pope's first visit to Syria, the mood in the country has been jubilant. Although Syria has been criticized for its links with Palestinian radicalism and sponsorship of such terrorist groups as Hezbollah, it also supports a variety of religious communities, including about 200 Jews, 2 million Christians and several Islamic sects.

The faiths are interwoven in sometimes improbable ways. In the hills of Ma'aloula, outside Damascus, Muslims bring their sick to the cliff-side tomb of Saint Takla, who fled Roman pursuit in Turkey and was said to be sheltered in the Syrian countryside by a crack miraculously riven in the earth when she approached. In Damascus's Old City, Muslims buy and sell Christian icons, a change from when Islamic conquerors chiseled the faces from statues, believing that images of the human face were sinful.

The Umayyad mosque is a window on how varied the practice of Islam can be. On Thursday night, the mosque was a sprawl of community activity. Bearded, conservatively dressed men huddled in one corner for a Koran lesson. Groups of women chatted casually against the walls. Children turned the open, carpeted space into a playground, running, wrestling and climbing on a repairman's scaffold.

In the middle stood John's tomb, covered in a cloth embroidered with Islam's 99 names of God, as well as the Muslim's central creed: There is no God but God. Around it huddled Muslims praying to one of the chief figures of Christianity, supplicating with their hands and scribbling private prayers on the granite walls.

"We welcome Christians all the time here. We are close," said Ahmed Mohammed, 42. "Jesus is part of Islam, and will come and run the whole world with the peace of God."

"If people only knew what Islam was about," said Sheikh Nizzar Khattib, the prayer leader at the Umayyad mosque for 40 years. "The teachings are the same. That this globe was created by one God. There is right and wrong . . . Christ and Mohammed and Moses are one."

A Syrian girl greets Pope John Paul II during Mass in Damascus. The pope has struck a theme of interfaith tolerance during his trip following the path of the apostle Paul.