Under the last-minute agreement on Thursday, Britain will rename the consulate, founded in 1839, as the "UK Mission" in the city.
Israel said 20 British diplomats including the consul general would depart, leaving just seven working at the mission in a limited role.
Britain said it had withdrawn some diplomats "temporarily", intended to build back its presence, and would hold off on reciprocal measures for now.
The agreement appeared to ward off a major diplomatic crisis between longstanding allies.
In recent days, sources had said Britain had been prepared to consider ejecting Israeli diplomats if the mission were closed.
Israel had issued a 30-day deadline in September for Britain to close the consulate, after London announced sanctions targeting Israeli settlements in the occupied West Bank, including a ban on trade in goods from there.
In a statement, Israeli Foreign Minister Gideon Saar said the consulate would formally end operations but some British diplomats would be allowed to continue working there.
Saar's British counterpart, Ed Miliband, said his country did not accept that Israel has the legal right to close the consulate.
The consulate is in a part of the city Israel captured in a 1967 war, which Israel later annexed in a move that most countries do not recognise.
Following discussions with Israel, "our consulate general building will not be closing, and will be known as the UK Mission, Jerusalem from today", Miliband said.
It would continue to "deliver vital services and our work with the Palestinian people".
On Thursday morning, workers in the consulate removed a plaque reading "British Consulate General" and another sign for its consular section.
The British flag was still flying over the building.
Saar said Israel and Britain had reached an understanding on Wednesday night to prevent a further deterioration in relations between the two countries, and that Britain had agreed not to take any measures in retaliation.
Miliband said Britain had "temporarily withdrawn a number of staff and families to ensure their safety and security" and that it would work in the coming months to build back its presence.
"We will not take reciprocal action while such discussions are under way and credible," Miliband said in a statement.
The closure order does not affect Britain's embassy in Tel Aviv, which handles diplomatic relations with Israel's government.
The consulate, in the Sheikh Jarrah neighbourhood of East Jerusalem, has handled Britain's relations with Palestinians in Jerusalem, the West Bank and Gaza, andprovided consular services to Palestinians.
The British sanctions announcement, and Israel's order to close the consulate, mark a new low in a relationship that has deteriorated over the past three years.
Britain has repeatedly criticised Israel over its actions in the war in Gaza and over Israeli settler attacks on Palestinians in the West Bank.
Prime Minister Benjamin Netanyahu's government, which faces an election later this month, has accused Britain's governing Labour Party of being hostile towards Israel.