(Reuters) - Pope Francis made a surprise stop at the hulking wall Palestinians see as a symbol of Israeli oppression on Sunday, minutes after begging both sides to end a conflict that he said was no longer acceptable.

In an image set to become one of the most emblematic of his trip to the holy land, a somber-looking Francis rested his forehead against the concrete structure that separates Bethlehem from Jerusalem, and prayed silently as a child holding a Palestinian flag looked on.

He stood at a spot where someone had sprayed in red paint "Free Palestine". Above his head was graffiti in broken English reading: "Bethlehem look like Warsaw Ghetto", comparing the Palestinian plight with that of the Jews under the Nazis.

Israel says the barrier, erected 10 years ago during a spate of Palestinian suicide bombings, is needed to secure its security. Palestinians see it as a bid by Israel to partition off territory and grab land they want for their future state.

On the second leg of a three-day trip to the Middle East, Francis delighted his Palestinian hosts by referring to the "state of Palestine", giving support for their bid for full statehood recognition in the face of a paralyzed peace process.

But, speaking at the birthplace of Jesus in the Palestinian-run city of Bethlehem in the Israeli-occupied West Bank, he made clear that a negotiated accord was needed, calling on leaders from both sides to overcome their myriad divisions.

Francis invited the Israeli and Palestinian presidents to come to the Vatican to pray for an end to the enduring conflict, just a month after the collapse of U.S.-backed peace talks.

"In this, the birthplace of the Prince of Peace, I wish to invite you, President Mahmoud Abbas, together with President Shimon Peres, to join me in heartfelt prayer to God for the gift of peace," the Pope said at an open-air Mass in Bethlehem.

A spokeswoman for Peres said in Jerusalem that the president "always accepts any kind of initiative to promote peace". While Abbas heads the Palestinian government, Peres's post is largely ceremonial and he is due to leave office in July.

PROTEST

Francis had flown by helicopter to Bethlehem from Jordan, where he started his tour on Saturday, becoming the first pontiff to travel directly to the West Bank rather than enter via Israel - another nod to Palestinian statehood aspirations.

He was due to travel to Israel later in the day for a swirl of meetings, with some 8,000 police deployed in Jerusalem to guarantee his security.

Israeli police said they arrested 26 people who took part in a protest early on Sunday by Jewish nationalists at the Cenacle in Jerusalem, the traditional site of Jesus's Last Supper, where Francis is due to hold a Mass on Monday.

The protesters say the authorities are preparing to hand the Church the site, where some Jews believe King David is buried. The Israeli government has denied any such deal.

Israel has blamed the Palestinian president for the failure of the latest peace talks, but standing alongside Abbas, Francis pointedly referred to him as "a man of peace and a peacemaker".

Although the Vatican said the primary purpose of this visit was religious, political overtones were ever present.

A mural behind the altar at the Bethlehem Mass showed Jesus, who was a Jew, swaddled in a Palestinian keffiyeh, with his father, Joseph, also wearing the black and white headdress, made famous by the late Palestinian leader Yasser Arafat.

Pictures equating Palestinian suffering with that of Christ dotted the city. The pope was later due to meet refugees at a camp set up after the 1948 creation of Israel, when hundreds of thousands of Palestinians fled, or were forced to abandon their homes.

To avoid a diplomatic tangle, Francis will then get back in his helicopter and fly to Tel Aviv airport for a welcoming reception from Israeli leaders, rather than drive the short distance to Jerusalem.

Israel calls Jerusalem its eternal and undivided capital, having annexed Arab neighborhoods seized in the 1967 war, including the Old City, the site of the main religious shrines. The rest of the world has not recognized the annexation.

From Tel Aviv, he will fly to Jerusalem for what he has said is the main purpose of the trip - to commemorate the 50th anniversary of a historic meeting of Catholic and Orthodox Christian leaders, who moved to end centuries of bitter divisions between the two churches.