President Trump declared on Thursday that the United States should recognize Israel’s authority over the long disputed Golan Heights, delivering a valuable election-eve gift to Prime Minister Benjamin Netanyahu but jettisoning decades of American policy in the Middle East.

Mr. Trump’s announcement, in a midday Twitter post, came after persistent pressure from Mr. Netanyahu, a close political ally who is fighting for his survival in the election scheduled for April 9, and has invoked his friendship with the American president as a prime argument for staying in office.

But Mr. Trump’s move, while popular in Israel and among some lawmakers in Congress, is likely to be condemned almost everywhere else. The United Nations has rejected Israel’s occupation of the Golan Heights since 1967, when Israeli troops seized the 400 square miles of rocky highlands from Syria during the Arab-Israeli war.

[Sign up for the weekly At War newsletter to receive stories about conflict and consequence.]

It will also reverberate throughout the Middle East and could undermine Mr. Trump’s long anticipated peace proposal for Israel and the Palestinians. The White House has been enlisting support for the plan among Arab leaders who now face the prospect of acquiescing in the loss of land they had long claimed as Arab.