President-elect Donald Trump on Thursday managed to cast his first veto, a month before taking office — effectively killing an Israel-bashing UN resolution.

The Security Council measure called for an immediate halt to all Israeli settlement activity in the West Bank. Egypt had floated it as a favor to the Palestinian Authority, which is eager to delegitimize the Jewish state.

Team Obama could have quashed the move long ago by simply telling Cairo it opposed the resolution. But it stayed silent — so the Egyptians cautiously went ahead.

Then Trump announced that the resolution “should be vetoed.” Why? “As the United States has long maintained, peace between the Israelis and Palestinians will only come through direct negotiations between the parties, and not through the imposition of terms by the United Nations.”

Exactly: Should Palestinian leaders ever be willing to negotiate a final peace deal, the settlements can get resolved along with everything else. Israel’s 2005 pullout from Gaza shows it can force settlers to un-settle.

Soon after Trump’s statement dropped, Cairo — at its wits’ end with the Obama crew, and hoping for better US relations — shelved the resolution indefinitely.

Obama’s diplomats vetoed a similar resolution in 2011. Letting this one pass would’ve been a drastic break with US policy — which makes the US silence all the more bizarre.

Hand it to Trump for breaking the logjam — and for showing the kind of leadership the world sorely needs.