Israel’s attempt to close the British consulate general in Jerusalem was primarily designed to deter London from imposing sanctions on settlements in occupied Palestine. But it also served the current government’s ambitions to fully annex Jerusalem as a national capital, diplomatic and legal experts said.

The UK mission to the city has an unusual diplomatic status, which dates back to before the founding of the state of Israel, rooted in a vision of Jerusalem as a neutral enclave under international control.

Unlike other consulates general around the world, it is not a satellite of the British embassy in Tel Aviv. Instead its diplomats are part of an independent team, who report directly to London.

That is anathema to those in Israel who claim all of Jerusalem as their territory. Israeli forces occupied East Jerusalem in 1967, and the Knesset passed a law annexing the city in 1980, but that status has not been recognised by most of the world.

Gideon Sa’ar, the Israeli foreign minister, threatened to close the consulate general a month ago in an attempt to deter the UK government from proceeding with plans to bar trade with West Bank settlements and put sanctions on companies that provide them with services including financing.

The UK threatened to respond with a mass expulsion of diplomats but the two countries appear to have backed away from a full-blown diplomatic spat as Israel prepares for national elections, due on 27 October.

Britain will rebrand its consulate general ⁠as a UK “mission” and reduce the number of diplomats, but it will remain independent of Tel Aviv in a compromise one source described as a temporary “ceasefire”. If Israel gets a new leader in three weeks, negotiations on the status of the consulate and its staff could resume.

Maintaining a foothold in Jerusalem and the independent status of UK diplomats was important, said Daniel Seidemann, an Israeli lawyer and expert in the geopolitics of Jerusalem who has advised western diplomats including a British foreign secretary.

“The arrangement that the UK arrived at with Israel was probably the optimal among a number of options that were even worse. So I’m not faulting anybody, but this is far from a victory,” he said.

“The British presence in Jerusalem after almost a century and a half has been downgraded from one of the diplomatic mission to another office. And that is a stark qualitative change.”

Maintaining a foothold in Jerusalem and the independent status of UK diplomats was important, one expert said. Photograph: Mostafa Alkharouf/Anadolu/Getty Images

There are seven other consulates general in East Jerusalem, all opened before 1948, representing their nations’ interests in Jerusalem and occupied Palestine. Like the UK one, they are independent and report directly to their foreign ministries.

They have long been a particular thorn in Israel’s side because of their unusual status, which reflects the designation of Jerusalem as “corpus separatum”, an independent body, under the UN’s 1947 partition plan for historic Palestine.

Never implemented, it envisaged Jerusalem as a sort of Vatican-like independent enclave, under international administration. That clashes with Israel’s claim on the city, and Sa’ar’s attack on the consulate should be seen in that context, and not purely as a response to sanctions.

“This is part of the overall attempt to establish the primacy of a very specific Jewish-Israeli Jerusalem,” Seidemann said. “Any diplomatic presence in Jerusalem that does not pay fealty to the government of Israel and Israel’s sole sovereignty is targeted.”

Other countries have missions based in Ramallah to manage relations with Palestinians, but these are technically subsidiary to Tel Aviv embassies.

The US had a consulate general but closed it after Donald Trump recognised Jerusalem as the capital of Israel during his first presidency.

The UK sanctions plan represents the most consequential attempt by one of Israel’s allies to halt settlement expansion in the occupied West Bank. Israeli banks are rattled by a proposal they fear could affect their business, Haaretz reported on Thursday.

An assessment by Israel’s Association of Banks laid out concerns that they could be affected, and they are refusing to say whether they will provide financial guarantees needed to underpin construction contracts for the E1 settlement in the West Bank.

When Ed Miliband, the UK foreign secretary, announced his plans, he said the timing was driven partly by the Israeli government’s decision to put out tenders for this project. Israel’s finance minister, Bezalel Smotrich, has boasted that it will “bury” the possibility of a Palestinian state by severing parts of the occupied West Bank.

Ilan Baruch, a former Israeli ambassador to South Africa, left diplomatic service to advocate for a two-state solution, including pushing foreign governments to move beyond condemnations of Israeli policy to imposing a “meaningful price”.

The threats to Britain’s Jerusalem consulate were a sign the UK had finally done that. “I was relieved [by Israel’s position], realising Miliband touched a nerve,” he said.

Renaming the consulate while preserving its independent status indicated Israel had stepped back from confrontation, helped by Britain making smaller “face-saving” concessions, he said.