Earlier, the pontiff said he prayed for a lifting of Israel's embargo on Gaza.

The BBC's Tim Franks said that the Pope used the stark backdrop of a Palestinian refugee camp to deliver one of his strongest expressions of support for the Palestinians.

Standing in the shadow of Israel's separation wall in the Aida refugee camp, which houses refugees from Israel's creation in
1948,
the Pope called the barrier a symbol of "stalemate" between Israel and the Palestinians.

David Willey, BBC News, Bethlehem

It's Christmas all over again in Bethlehem this fine May day. O Come All Ye Faithful and Gloria In Excelsis rang out over Manger Square as Pope Benedict celebrated mass for an enthusiastic congregation of several thousand Palestinian Christians and Catholic Pilgrims from as far away as Vietnam.

They protected themselves from the fierce sun with yellow and white baseball hats - the colours of the Vatican flag, handed out by attendants - and they waved Palestinian flags. The atmosphere was festive despite the heavy security and checkpoints set up along all roads leading to the town where Jesus Christ was born.

Business went on as usual in the nearby cafes and souvenir shops while Pope Benedict, clothed in gold vestments, preached about the injustices suffered by the Palestinians in general and Gazans in particular as a result of the continuing conflict with Israel. His audience applauded wildly as he referred to the tiny knot of Catholic pilgrims from Gaza who had been allowed to travel to Bethlehem.

"In a world where more and more borders are being opened up - to trade, to travel, to movement of peoples, to cultural exchanges - it is tragic to see walls still being erected," he said.

He told the refugees that his heart went out to families divided by detention and restrictions on freedom of movement, a reference to Israeli military control of the West Bank.

"It is understandable that you often feel frustrated. Your legitimate aspirations for permanent homes, for an independent Palestinian state, remain unfulfilled."

He added: "Although walls can be easily built, we all know that they do not last forever. They can be taken down. First, though, it is necessary to remove the walls that we build around our hearts."

Mr Abbas said Israel's security could only be attained through peace.

"In front of Your Holiness I address a message of peace to our Israeli neighbours," he said.

"And I call upon them to renounce occupation, settlements, arrests, and humiliations."

The BBC's David Willey in Bethlehem says that, on his journey from Jerusalem, the Pope saw for himself for the first time the barrier that the Israelis have erected in the West Bank.

Israel says it is to prevent attacks by militants, but Palestinians say it is to seize occupied land.

Speaking at a news conference at Mr Abbas's residence, the head of the Roman Catholic Church expressed support for a Palestinian state.

"The Holy See supports the right of your people to a sovereign Palestinian homeland in the land of your forefathers, secure and at peace with its neighbours, within internationally recognised borders," he said.

Although the Christian population of Bethlehem has decreased dramatically in recent years through emigration, the Pope was given an enthusiastic welcome, our correspondent says.

A tiny group of Catholics from Gaza was present, after receiving special permits from the Israeli authorities to travel to the West Bank.

Pope Benedict is due to have a further meeting with Mr Abbas before his departure.

On Tuesday, the Pope visited sites in Jerusalem holy to Muslims, Jews and Christians.

He went first to the Dome of the Rock, the first pontiff to do so. It is located on the Temple Mount - a site sacred to all three monotheistic religions, and met the Grand Mufti of Jerusalem, Mohammed Mohammad Hussein.

Then the Pope followed Jewish tradition at the Western Wall, inserting a written prayer in the cracks between the 2,000-year-old stones.

This page is best viewed in an up-to-date web browser with style sheets (CSS) enabled. While you will be able to view the content of this page in your current browser, you will not be able to get the full visual experience. Please consider upgrading your browser software or enabling style sheets (CSS) if you are able to do so.