The timing of President Trump’s Thursday endorsement, via Twitter, of Israeli ownership of the Golan Heights clearly had much to do with upcoming elections in Israel and the United States.

For Israeli Prime Minister Benjamin Netanyahu, facing a surging opposition in a vote just weeks away, U.S. recognition of sovereignty over the occupied Syrian territory is a political gift. For Trump, just launching his 2020 campaign, it added to his self-depiction as best friend to Israel and U.S. evangelicals, challenged by a Democratic Party that he describes as “anti-Israel” and “anti-Jewish.”

But national security adviser John Bolton bypassed any notion of a crass political motive Friday, tweeting that to allow the Golan Heights “to be controlled by the likes of the Syrian or Iranian regimes would turn a blind eye to the atrocities of Assad and the destabilizing presence of Iran in the region.”

“Strengthening Israel’s security,” Bolton wrote, “enhances our ability to fight common threats together.”

Trump’s recognition changes nothing in terms of international law, which does not recognize Israel’s claim. At the same time, there has been virtually no serious international pressure on Israel to give up the Golan, an elevated plateau of basalt east and north of the Sea of Galilee, seized from Syria in the 1967 Israeli-Arab War. About 20,000 Israelis live there in several dozen settlements, along with an equal number of Druze who seem in no hurry to reassert their Syrian citizenship.

Syria unsuccessful tried to retake the territory in 1973, and the two sides agreed to a narrow demilitarized zone along their frontier that is under the military control of the United Nations. In 1981, Israel passed a law effectively annexing the territory, from which Syria is visible all the way to the southern suburbs of Damascus, about 40 miles away. The Golan is now home to Israeli farms and vineyards, as well as Israel’s only ski resort.

Yet Iranian forces and their proxies, including Hezbollah, also have moved into southwestern Syria, as part of their assistance to President Bashar al-Assad’s efforts to regain the territory from opposition forces.

Assad’s largely successful efforts have come despite a 2017 cease-fire deal, signed by the United States and Russia, that included a Russian pledge to keep the Iranians at least 50 miles away from the area.

The Iranians, Israel has charged, are positioning themselves and Hezbollah to emplace missile sites capable of targeting Israel, a number of which have already been destroyed by Israeli airstrikes.

“That’s what began the push” to recognize Israeli sovereignty, said Mark Dubowitz, chief executive of the Foundation for Defense of Democracies and a strong proponent of pressure against Iran. “That’s what supercharged it as those Iranian actions became more aggressive and threatening.”

Netanyahu reportedly appealed to Trump on the Golan last year, shortly after the president announced he would move the U.S. Embassy in Israel from Tel Aviv to Jerusalem. But the campaign did not begin to gain real traction until Bolton, an ardent hawk on Iran, arrived at the White House last spring. Talks underway with Russia to restart the cease-fire agreement — negotiating joint drawbacks of U.S. and Iranian forces — largely fell apart, according to senior officials involved in the process, when Bolton decreed that no U.S. troops would leave until all Iranian forces were out of Syria. The officials spoke on the condition of anonymity because they were not authorized to discuss the Russia talks.

Even before Trump’s announcement, the prospect of recognizing Israeli sovereignty over the Golan had been met with wide approval from U.S. lawmakers. Sens. Ted Cruz (R-Tex.), Tom Cotton (R-Ark.) and Rep. Mike Gallagher (R-Wis.) last month introduced bills in both houses of Congress to do so.

Cotton had urged Trump and Secretary of State Mike Pompeo in private conversations in recent weeks to take a position on the issue, according to a Cotton aide who was not authorized to speak publicly. Cruz’s office had repeatedly engaged with the State Department and White House for months on the issue — including a six-point plan he wrote last summer for deepening Israeli control over the territory — as had Sen. Marco Rubio (R-Fla.), according to GOP aides.

Early this month, Sen. Lindsey O. Graham (R-S.C.), a staunch Israel supporter, visited the country and was escorted by Netanyahu on a trip to the Golan Heights. As they stared through telescopes into Syria, Netanyahu declared that “the Golan must stay part of Israel forever.”

Graham enthusiastically agreed, saying that “to give this territory up would be a strategic nightmare for the state of Israel” and pledging to press the issue with Trump as soon as he got home.

Dubowitz said that Trump’s decision in December to withdraw all 2,000 U.S. troops from Syria — despite Bolton’s earlier assurance that they would stay beyond the defeat of the Islamic State, until Iran left — also played a role, even though the president has now agreed several hundred can remain. It “meant the administration has become even more reliant on Israeli military power to neutralize and roll back Iranian military infrastructure in Syria,” he said.

Michael Makovsky, president of the Jewish Institute for National Security of America, known as JINSA, commended Trump’s decision and agreed that it was closely related to the question of “how to manage Syria going forward.”

“I do think that it’s helpful for the United States, as it’s reducing its footprint — which I think is a mistake — also to kind of assert that we’re still a player on Syria,” Makovsky said. “It’s common knowledge that allies in the region see the U.S. as withdrawing” so “the timing of this is helpful.”

Trump’s tweeted announcement provoked far greater reaction in the United States and Israel than in the rest of the Middle East. U.S. Arab allies, perhaps weary of changing U.S. policies, and still awaiting a promised administration Israeli-Palestinian peace proposal, declared that any recognition of Israeli sovereignty over the Golan would undermine prospects for peace and was illegal under international law. Trump’s statement “will not change the reality” of Israeli occupation, said Abdul Latif al-Zayani, secretary general of the Gulf Cooperation Council.

While JINSA tends to represent the conservative side of Jewish national security thought in this country, J Street, another Washington-based organization, has a different perspective. Trump’s words, said J Street President Jeremy Ben-Ami, had little to do with Middle East strategy and were intended to help Netanyahu in a tough election fight two weeks from now.

“It adds to the narrative that somehow the relationship he forged with President Trump is bringing an unending bounty of goodies,” Ben-Ami said, and will probably affect a future discussion of annexing at least part of the West Bank.

“They’re not tied together. But the principle that when Israel declares annexation in contravention of international law and . . . long-standing American policy, the U.S. may recognize it, is a precedent many of [Israel’s] right-wing settlers are hoping can be replicated on the West Bank.” Assuming Netanyahu is reelected, he said, “you can count on it happening.”

Aaron David Miller, a Wilson Center scholar who worked on Israeli-Arab negotiations under six secretaries of state, called it “pure and unadulterated domestic politics” that will boost Netanyahu’s chances, as well as garner support for Trump and other Republicans from evangelical Christians and “a substantial portion” of the Jewish population in the United States.

“In a psychological sense, the administration is saying, ‘We stand with Israel,’ ” Miller said. “But I do not see this . . . serving as any sort of constraint on Iranian or Hezbollah behavior. And it could incentivize them.”

Miller said he has watched previous Republican and Democratic administrations “play favorites” with Israeli governments. “But nothing as willful or as brazen or as transparent as this,” he said.

Seung Min Kim contributed to this report.