French President Emmanuel Macron shouted at Israeli security forces on Wednesday, during the first day of his official visit to Jerusalem for the World Holocaust Forum.
The president's visit to the forum coincided with the 75th anniversary of the liberation of Auschwitz.
The heated exchange took place outside the medieval Church of St Anne in Jerusalem’s Old City.
The place of worship has been property of the French government since 1856, when Ottoman Sultan Abdulmecid gave it to Napoleon III for his help in the Crimean War.
Israeli security had been escorting Mr Macron around the city, but as the church is technically French territory, troops are not allowed into the building. That did not stop them trying.
“I don’t like what you did in front of me,” he said angrily in English to Israeli security forces.
“Go out. Outside. I’m sorry, but we know the rules. Nobody has to provoke. Nobody.
“Please respect the rules,” he said. “They are for centuries. They will not change with me.”
An Elysee Palace spokesman said Mr Macron was reacting to an “altercation” between French and Israeli security forces.
"It is the role of France in this city to protect this place,” the spokesman said. “The Israeli security forces wanted to enter it while security was assured by French forces.”
The outburst was reminiscent of a 1996 visit by then French president Jacques Chirac, who also got angry at Israeli security accompanying him in Jerusalem. He refused to enter the Church of St Anne until Israeli troops left.
Israeli police and the domestic intelligence agency, Shin Bet, said on Wednesday that after Mr Macron finished his visit he apologised and shook hands with the security workers.
Earlier that day he visited other sites in the Old City, including Church of the Holy Sepulchre, Al Aqsa Mosque and the Western Wall.
Al Aqsa Mosque, the third holiest site in Islam, is inside the contested holy site called the Noble Sanctuary, or Haram Al Sharif.
He later visited Mahmoud Abbas, the President of Palestine, in Ramallah in the West Bank.