A diplomatic spat erupted between the US and Israel days before President Trump’s planned visit after an American official declared that the Western Wall — the holiest site in Judaism — is not part of the country.

An Israeli team that joined US officials on a scouting trip Monday requested that Prime Minister Benjamin Netanyahu accompany Trump and his family to the site.

“This isn’t your territory. This is in the West Bank. It is a private visit by the president, and it’s not your business,” responded one US official, according to the Times of Israel.

Israel’s Channel 2 identified him as David Berns, the political counselor at the US Consulate in Jerusalem, and said he was accompanied by economic adviser Jonathan Shrier, who also was involved in the row.

Netanyahu’s office expressed its shock at the incendiary statement and sought a clarification from Washington.

“The comments about the Western Wall were not authorized communication and they do not represent the position of the United States and certainly not of the president,” the White House told the Israeli paper.

The TV report said Berns’ job might be in jeopardy because the incident embarrassed the White House ahead of Trump’s scheduled May 22-23 visit.

Israel captured the Old City and the rest of East Jerusalem in the Six-Day War of 1967, and considers the entire city to be its eternal capital.

The Western Wall — part of the retaining walls of the Second Temple compound — is the closest point to the site of the Temple itself where Jews can pray.

Next week, the nation will celebrate the 50-year anniversary of what it calls the unification of Jerusalem.

But the international community does not recognize Israel’s annexation of East Jerusalem, which the Palestinians seek as the capital of a future independent state.

The Old City also is home to the Al Aqsa Mosque, the third-holiest site in Islam.

With Post wires