President Barack Obama has decided to go out with a bang: In a stunning diplomatic rebuke of Israel, the United States on Friday abstained on a controversial United Nations Security Council resolution demanding an end to Israeli settlements on Palestinian territory, allowing it to pass easily.

By abstaining — instead of vetoing the resolution, as the United States has reliably done to similar measures for decades — the Obama administration allowed the highly symbolic measure to make it through the chamber.

It was the first time in nearly 40 years that the Security Council has passed a resolution critical of Israeli settlements. It was also a firm rebuke of both Israeli Prime Minister Benjamin Netanyahu, who had strongly argued against it, and President-elect Donald Trump, who had taken the highly unprecedented move of weighing in Thursday and pressing for the measure to be vetoed.

The measure demands that Israel “immediately and completely cease all settlement activities in the occupied Palestinian territory, including East Jerusalem,” and declares that the establishment of settlements by Israel has “no legal validity and constitutes a flagrant violation under international law.”

This is far stronger language than the United States has ever officially used to describe Israeli settlement activity before. Although the standard US position has for three decades been that such settlements, which are built on land intended to be part of a future Palestinian state, are “obstacles to peace,” the United States has always stopped short of describing them as “illegal” under international law.

The Obama administration’s stunning vote was thus a dramatic shift in longstanding US policy. And it was no accident.

The move was Obama’s parting shot at Netanyahu, with whom Obama repeatedly clashed throughout his tenure. As my colleague Zeeshan Aleem writes, although the Obama administration gave Israel a bigger military aid package than any US president in history, and has vetoed past UN condemnations of settlements, Obama had a “tense and at times outright hostile relationship with the right-wing Netanyahu.” Among other things, they clashed over Israeli settlement expansion and the terms of the controversial Iran nuclear deal.

But Obama’s parting shot was also aimed at Trump, who has indicated he wants to take a much stronger pro-Israel stance. For instance, he has said he wants to move the US embassy to Jerusalem: a step that, as my colleague Zack Beauchamp explains, “every US government has refrained from doing because the future of the disputed city is meant to be resolved as part of direct talks between the two sides for a final status peace deal.”

And Trump’s newly named ambassador to Israel, David Friedman — who has been a personal friend of Trump’s for about 15 years — is staunchly pro-settlement.

Indeed, it seems that an unprecedented intervention by Trump himself — in the form of a personal phone call to Egyptian President Abdel Fattah el-Sisi — is the primary reason why Egypt, which had initially sponsored the UN measure, decided on Thursday to delay the vote indefinitely.

Mere hours before the vote was scheduled to take place, Trump issued a statement on Facebook calling for the US to veto the measure. Shortly after, Egypt announced it would be delaying the vote. Trump spokesperson Sean Spicer later confirmed that Trump had indeed spoken directly with both Sisi and Netanyahu about the proposed Security Council action. Friday’s resolution was sponsored by New Zealand, Malaysia, Venezuela, and Senegal — not Egypt.

It may very well have been this stunning intervention by Trump, directly meddling in a major US foreign policy decision before he has even taken office, that ultimately pushed Obama to take the dramatic step of abstaining on Friday’s vote.

Shortly after the UN measure passed on Friday, Trump reacted on Twitter by suggesting he intends to take a stronger line on defending Israel at the UN when he takes office: