French President Emmanuel Macron has engaged in a heated argument with Israeli security officials, demanding they leave a Jerusalem basilica that he visited before a Holocaust memorial conference.

The French tricolour has flown over the Church of St Anne in Jerusalem's walled Old City since it was gifted by the Ottomans to French Emperor Napoleon III in 1856.

France views it as a provocation when Israeli police enter the church's sandstone complex, in a part of Jerusalem captured and annexed by Israel in the 1967 Middle East war.

The incident was a case of deja vu all over again. In 1996, France's then-president Jacques Chirac lost patience with Israeli security agents at the same church, telling one of them that his treatment was a "provocation" and threatening to get back on his plane.

Mr Chirac refused to enter the building until Israeli security left the site.

Video showed President Macron, jostled in the centre of a crowded circle between his own protective detail and Israeli security personnel, including several paramilitary policemen in uniform, under an archway leading into the church.

Mr Macron then stopped the shoving and shouted at the Israeli security guards in English: "I don't like what you did in front of me."

Lowering his voice, he then said: "Go outside. I'm sorry, you know the rules. Nobody has to provoke nobody."

Speaking later to reporters, President Macron said the incident ended pleasantly and that he shook hands with the Israeli security officials.

Israeli police said that when Mr Macron arrived at the church "there was a discussion" between Israeli and French security officers about entering with the president.

"When the president and the delegation finished the visit, he apologised about the incident and shook hands with the security personnel," a police statement said.

President Macron is one of dozens of world leaders who will attend tomorrow's World Holocaust Forum at Yad Vashem Holocaust memorial centre in Jerusalem, which will commemorate the 75th anniversary of the liberation of the Auschwitz death camp in what was then occupied Poland.

The 42-year-old head of state had seen his visit to the Church of St Anne as a symbolic stop underscoring France's historical influence in the region.

Before heading to the church, President Macron walked through Jerusalem's Old City, stopping by the Church of the Holy Sepulchre.

He later visited the Muslim Noble Sanctuary that houses al-Aqsa mosque, a site revered by Jews as Temple Mount, and prayed at Judaism's Western Wall, touching the ancient stones.