When Donald J. Trump was last president of the United States, the wealthy monarchies of the Persian Gulf had a mostly harmonious relationship with his administration. As Mr. Trump prepares to return to the White House, the leaders of those Gulf countries have generally welcomed him back.

But this time around, the Gulf states and Mr. Trump appear to be diverging on several cornerstone issues, like Israel and Iran. Differences over energy policies could also be a source of friction.

It is unlikely that there will be major tensions or ruptures with U.S. allies in the Gulf. But Mr. Trump will be encountering a region that has seen drastic shifts since Israel launched its war on Gaza in response to the Hamas-led attack of Oct. 7, 2023, in which the Israeli authorities say about 1,200 people were killed and about 250 taken hostage.

The war in Gaza, in which at least 45,000 people have been killed, according to health officials in the enclave, has rippled across the region. In Lebanon, the Iran-backed militant group Hezbollah has been battered by more than a year of fighting against Israel. And in Syria, rebels toppled the regime of Bashar al-Assad.

Now, while Mr. Trump is filling his cabinet with Iran hawks and staunch defenders of Israel, Gulf leaders have publicly been urging a softer stance on Iran and a tougher line on Israel.

They have also been calling on the United States to stay engaged with the region.

For now, the Trump administration has appeared eager to engage with the Gulf powerhouses of Saudi Arabia, Qatar and the United Arab Emirates.

In December, Mr. Trump’s pick as his envoy to the Middle East, Steve Witkoff, was in the Emirati capital, Abu Dhabi, where he attended a Bitcoin conference along with Eric Trump, the president-elect’s son. He also went to Riyadh, Saudi Arabia, where he met with Crown Prince Mohammed bin Salman, Axios reported.

Here’s a closer look at the issues facing Mr. Trump as he navigates an evolving relationship with his traditional Gulf allies.

One of the clearest calls in the Gulf for Mr. Trump to avoid an isolationist agenda came from Prince Turki al-Faisal, the former head of Saudi Arabia’s intelligence services.

In an open letter to the U.S. president-elect published in November in The National, an Abu Dhabi-based newspaper, Prince Turki referred to an assassination attempt against Mr. Trump and expressed his belief that “God spared your life” in part so Mr. Trump could continue the work he had started in the Middle East during his first term. That mission was to bring “PEACE, with capital letters,” he wrote.

During his first term, Mr. Trump’s administration brokered the Abraham Accords that saw several Arab countries establishing ties with Israel.

A similar message to Prince Turki’s was delivered a few days later by Anwar Gargash, an adviser to Sheikh Mohammed bin Zayed, the U.A.E. president, at a conference in Abu Dhabi.

With the Gulf surrounded by an increasingly turbulent region, Mr. Gargash said, American leadership and partnership remained essential. “We need robust leadership that balances humanitarian concerns with strategic interests,” he said.

On Israel, the most striking shift in messaging in the Gulf has come from the de facto leader of Saudi Arabia, the crown prince. Speaking at an Arab League summit in Riyadh recently, Prince Mohammed for the first time called the Israeli military campaign in Gaza a “genocide.”

Just before the war in Gaza erupted in October 2023, Saudi Arabia appeared to be on the verge of forging diplomatic relations with Israel without fulfilling its longstanding precondition for doing so — the establishment of a Palestinian state. Such a deal would have reshaped the Middle East.

Under one plan, Saudi Arabia would normalize relations with Israel in exchange for stronger defense ties with the United States and American support for a civilian nuclear program in Saudi Arabia.

But recent statements by Prince Mohammed suggest that any deals are a long way off.

In addition to his statement referring to genocide in Gaza, he has also made it clear that Saudi Arabia will not establish diplomatic relations with Israel until a Palestinian state is created. That is still a distant prospect given strong opposition to such a state within the government of Prime Minister Benjamin Netanyahu of Israel.

“I think that the crown prince wanted to make his position clear and beyond any shadow of a doubt,” said Ali Shihabi, a Saudi businessman who is close to the kingdom’s ruling family.

The United Arab Emirates — a signatory to the Abraham Accords — has also signaled a hardened stance toward Israel.

The U.A.E. foreign minister, Sheikh Abdullah bin Zayed, told his Israeli counterpart last week that the Emirates would “spare no effort supporting Palestinians.”

Despite Saudi Arabia’s public stance on the status of a normalization deal, U.S. diplomats have indicated that the kingdom may be privately open to advancing one under a second Trump presidency — contingent upon a permanent cease-fire in Gaza and a tangible commitment by Israel toward a path to Palestinian statehood.

“All of that is ready to go if the opportunity presents itself with a cease-fire in Gaza as well as understandings on a pathway forward for the Palestinians,” the departing U.S. secretary of state, Antony J. Blinken, said on Wednesday. “So, there’s tremendous opportunity there.”

During Mr. Trump’s first term, both Saudi Arabia and the United Arab Emirates championed his administration’s hawkish stance on Iran, seeing Tehran as a dangerous rival in the region.

They cheered when Mr. Trump withdrew the United States from a nuclear deal with Iran and hailed his decision to authorize the assassination of Qassim Suleimani, the general who directed Iran’s militias and proxy forces around the Middle East, in January 2020.

But the dynamics of the region have changed since Mr. Trump’s first term.

Saudi Arabia and Iran reached an accord in March 2023 that reduced tensions in the Persian Gulf and opened the door to high-level diplomatic contacts.

Bahrain, after years of tension with Iran, has made overtures to the Iranian government, with King Hamad bin Isa al-Khalifa saying there was “no reason to delay” the resumption of diplomatic relations. The tiny island kingdom also condemned Israel’s targeting of Iran last October, when a shadow war between the two countries broke out into the open with tit-for-tat attacks.

For Saudi Arabia, the goal is clear: to create a stable regional environment conducive to Prince Mohammed’s dream of diversifying the oil-dependent Saudi economy. For Iran, decades of economic and political isolation, compounded by rising domestic unrest, have made reconciliation with Riyadh a necessity.

There are also indications that Iran might be open to negotiating with Mr. Trump. Many former officials, pundits and newspaper editorials in Iran have openly called for the government to engage with Mr. Trump.

So far, Mr. Trump, too, appears open at least in charting a different course from the “maximum pressure” campaign of his first term. In November, Elon Musk, a close adviser to Mr. Trump, met with Iran’s ambassador to the United Nations, Iranian officials said.

“We have to make a deal because the consequences are impossible,” Mr. Trump said in September, referring to the threat of Iran’s pursuing nuclear weapons.

While the Gulf Cooperation Council countries — Bahrain, Kuwait, Oman, Qatar, Saudi Arabia and the United Arab Emirates — appear open to Mr. Trump’s transactional approach to diplomacy, they could find themselves at odds with his economic policies.

A central promise of his campaign was to bolster U.S. oil and gas production, a move that could hurt Gulf economies.

If the United States increases oil production, as Mr. Trump has pledged, producers in the Gulf would have less scope to raise output without prompting a price drop.

“Increased U.S. oil exploration and production will lower prices and jeopardize the oil-driven economies of the Gulf,” Bader al-Saif, an associate fellow at the London-based research institute Chatham House, said in a recent report.

Mr. Trump is also expected to accelerate liquefied natural gas projects, reversing President Biden’s freeze on permits and increasing U.S. exports, particularly to Europe.

Qatar, one of the largest producers of the gas alongside the United States, would most likely be most affected, but it has so far played down its concerns.