"Go outside," French President Emmanuel Macron demanded in English in a melee with Israeli security men on Wednesday, 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.

More:

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.

Wednesday's 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.

Chirac refused to enter St Anne until Israeli security left the site.

Video showed 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.

French President Emmanuel Macron gets testy with Israeli police in the church of Sainte Anne, Old City of Jerusalem. pic.twitter.com/14NjxLPvLA — Noga Tarnopolsky (@NTarnopolsky) January 22, 2020

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, Macron said the incident ended pleasantly and that he shook hands with the Israeli security officials.

Israeli police said that when 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.

An Israeli government spokesman did not immediately comment on behalf of the Shin Bet internal security agency, which also helps guard foreign dignitaries.

French diplomats had cautioned that they want to leave little room for mishaps on Macron's trip.

Earlier on Wednesday, a separate squabble ensued when Israeli police tried to enter St Anne before Macron's visit.

Macron is one of dozens of world leaders due to attend Thursday's World Holocaust Forum at the Yad Vashem Holocaust memorial centre in Jerusalem, which will commemorate the 75th anniversary of the liberation of the Auschwitz death camp.

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

Before heading to the church, Macron walked through the Old City, speaking to shopkeepers and stopping by the Church of the Holy Sepulchre.

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