French President Emmanuel Macron has confronted Israeli police during a tour of the Old City of Jerusalem.
Mr Macron accused officers of violating rules that prevent them from entering the Crusader-era Church of St Anne, which is considered French territory.
"I don't like what you did in front of me. Go outside, please," he warned them in English. "Nobody has to provoke."
The incident was reminiscent of one involving the late French President Jacques Chirac in the 1990s.
Mr Macron is in Jerusalem to attend the Fifth World Holocaust Forum, which is marking the 75th anniversary of the liberation of the Auschwitz-Birkenau concentration camp.
The Church of St Anne, which dates back to 1138, is the best-preserved Crusader church in Jerusalem. According to Christian tradition, the crypt enshrines the home of the Virgin Mary and her parents.
It is located in occupied East Jerusalem, to the north of the hilltop site known to Muslims as al-Haram al-Sharif and to Jews as the Temple Mount.
The French flag has flown over the Church of St Anne since the Ottoman Turks presented it as a gift to France in 1856 as a gesture of gratitude for aid in the Crimean War.
Videos circulated on Wednesday showed Mr Macron standing in an archway leading to the church, surrounded by French and Israeli security personnel.
The president is seen gesturing at an Israeli police officer in uniform and saying in a raised voice: "I don't like what you did in front of me. Go outside, please."
He continued: "I'm sorry, but we know the rules. Nobody, nobody has to provoke, nobody. We keep calm."
He then tells a plainclothes security officer: "We had a wonderful walk. You did a great job in the city. I do appreciate it guys.
"Please respect the rules as they are for centuries. They will not change with me. I can tell you, OK?"
An Israeli police spokesman said that as President Macron's delegation arrived at the Church of St Anne there was a "discussion" between Israeli and French security guards about who would be allowed to enter the site.
"The French president requested that the guidelines be respected and, based on the terms agreed upon ahead of time, an Israeli guard and a policeman escorted the president and his delegation inside," he added.
"When the president and the delegation finished the visit, he apologised about the incident and shook hands with the security personnel."
During a visit to the Church of St Anne in 1996 Mr Chirac became angry when Israeli security personnel shoved Palestinians, journalists and aides with him.
Also speaking in English, he asked them: "What do you want? Me to go back to my plane and go back to France? Is that what you want? Let them go. Let them go."
The Israeli government - led then, as it is now, by Benjamin Netanyahu - apologised to Mr Chirac, saying it had been done "to protect a friend".