Pope Francis faces a diplomatic high-wire act on Monday as he visits sacred Muslim and Jewish sites in Jerusalem on the final day of his Middle East tour.

The pontiff is rounding off a whirlwind trip which saw him issue a unique invitation to Israeli President Shimon Peres and Palestinian Authority President Mahmoud Abbas to pray with him at the Vatican to end the “increasingly unacceptable” Israeli-Palestinian conflict, as well as snatching a personal moment at Israel’s controversial security barrier.

Francis had promised the three-day pilgrimage, which began on Saturday in Jordan, would steer clear of political issues. But he ad-libbed from his scripted speech to condemn anti-Semitism, religious intolerance and those behind conflicts in the Middle East.

On Monday, Jews and Muslims are expected to scrutinize the pope’s every word and gesture as he seeks to bridge the religious divides in meetings with leaders from both sides.

The 77-year-old pontiff will meet the Grand Mufti of Jerusalem on the Temple Mount, Islam’s third holiest site.

He will then pray at the Jewish Western Wall before visiting the Yad Vashem Holocaust memorial site, where he will speak with Holocaust survivors, and become the first pope ever to lay flowers on Mount Herzl.

On Monday the pope will also celebrate mass at the site known as the Cenacle, or Upper Room, bringing into sharp focus a decades-long debate over the site where Christians believe Jesus had his Last Supper.

The site on Mount Zion, is located in a two-storey building also considered holy to Jews and Muslims, who regard it as the place where the biblical figure David was buried.

Thousands of cheering, flag-waving Christians welcomed the pope to Bethlehem on Sunday, where he celebrated mass in Manger Square.

He also made an unscheduled stop by the West Bank barrier, climbing out of his open jeep to pray, his forehead and hand resting against the wall, in a powerful show of support for Palestinians.

A message scrawled on the eight-metre (26-foot) high concrete barrier, said: “Pope we need someone to speak about justice.”

Israel says the barrier, which it began building in 2002, is crucial for security. Palestinians see it as a land grab aimed at stealing territory they want for a future state.

At the end of the open-air mass, the pope weighed in on the Middle East conflict, inviting Abbas and Peres to join him at the Vatican for a “heartfelt prayer” for peace.

In the wake of the latest breakdown in US-led peace talks, Francis called on leaders to show “courage” to achieve a peace based on a two-state solution, saying “building peace is difficult, but living without peace is a constant torment.”

A senior Palestinian official confirmed Abbas had accepted and would visit the Vatican on June 6, while Peres’s spokesman said only that the invitation was welcomed.

In a boost for relations between bickering Christians, Francis joined Orthodox Patriarch Bartholomew I in an historic joint prayer for unity between Rome and Constantinople.

The pair met, embraced and kissed at the Church of the Holy Sepulchre inside the walled Old City to mark the historic meeting 50 years ago between Pope Paul VI and Patriarch Athenagoras — the first easing of tensions between the Churches since the Great Schism in the 11th century.

Francis has said the main reason for Middle East visit was the meeting with Bartholomew I, and “to pray for peace in that land, which has suffered so much”.

But the Argentinian pope has also moved quickly after his election last year to make overtures to Jews and Muslims and set the tone for the trip by inviting two old friends from Buenos Aires, a rabbi and Muslim professor.