DUBAI, United Arab Emirates (AP) — In the waning moments of Iran's final televised presidential debate, one of the top candidates to replace the late hard-line President Ebrahim Raisi invoked the name of the one person who perhaps has done more than anyone to change the trajectory of the Islamic Republic's relationship with the wider world in recent years.

The next president could be "forced to either sell Iran to (Donald) Trump or spark a dangerous tension in the country” if economic problems aren't solved, warned Mohammad Bagher Qalibaf, Iran’s parliament speaker and a candidate in Friday’s election.

to unilaterally withdraw America from the Iran nuclear deal saw crushing sanctions reimposed and largely cut Tehran out of the world's economy. That worsened the political climate within Iran, already beset by . An escalating series of attacks on land and at sea followed, while .

on the militants in the Gaza Strip only added jet fuel to a fire now threatening to burn nearly every corner of the wider Middle East. Iran's support of an array of militias, including Hamas, Lebanon's Hezbollah and Yemen's Houthi rebels, and its unprecedented direct attack on Israel during the war, has made it a direct belligerent in the conflict.

What happens in both the war and with Iran's future may hinge directly on the United States, denounced by the Grand Ayatollah Ruhollah Khomeini as the “Great Satan” in the 1979 Islamic Revolution and still cursed at major events, such as a speech this week by the 85-year-old Supreme Leader Ayatollah Ali Khamenei.

Despite the vitriol, the U.S. has come up again and again in the campaign. Khamenei warned this week against supporting candidates who “think that all ways to progress pass through America," running in the race, Masoud Pezeshkian, who has fully embraced a return to the 2015 nuclear deal.

Among the six initial presidential contenders — — Trump has repeatedly emerged as a theme. One of them, former hard-line candidate Amirhossein Ghazizadeh Hashemi, contended that if Trump wins the U.S. presidential election, “we can negotiate with Trump and impose our demands on him.”

That wasn't an opinion shared by Shiite cleric Mostafa Pourmohammadi, who warned Iran should take part in talks now with the U.S. before a second possible Trump presidency. However, his campaign also printed a side-by-side poster showing the cleric and Trump in profile, declaring: “I am the one who can stand against Trump!”

Hard-line candidate Saeed Jalili also mocked his competitors as being “scared” of Trump, vowing to fight him.

For his part, Trump has brought up Iran while campaigning in recent days. Speaking to the “All In" podcast, Trump repeated that he had wanted to “make a fair deal with Iran” — while also trying to claim Iran's theocratic government that long has called for Israel's destruction would somehow have made a diplomatic recognition deal with Israel like the United Arab Emirates and Bahrain did during his presidency.

“A child could have made a deal with them — and (Joe) Biden did nothing,” Trump asserted.

Interestingly, President Biden's name hasn't been mentioned during the Iranian election debates. Before Raisi's death in a May helicopter crash, the U.S. under Biden had several rounds of indirect talks with Iranian officials.

While broadly criticizing Iran, particularly in the wake of the 2022 death of Mahsa Amini and the women's rights protests that followed, the Biden administration has opened the door to Iran accessing some frozen assets abroad. That includes a deal that saw , less than a month before the Israel-Hamas war began.

Then there are Iran's oil sales. While technically sanctioned, Iran recently reported selling 2.5 million barrels a day — with the lion's share likely going to China, possibly at a discount. Former Iranian Foreign Minister Mohammad Javad Zarif, who struck the nuclear deal under the relatively moderate President Hassan Rouhani and now supports the reformist candidate Pezeshkian, directly attributed those sales to the Biden administration's policies.

“That the crude sales have gone up was not a work by our friends, but when Biden came power they had a policy to loosen the bolt of sanctions," said Zarif, obliquely referring to hard-liners. "Let Trump come and find out what our friends will do.”

While wider talks in Vienna with world powers to restart the nuclear deal collapsed, Biden may be trying to replicate a strategy from when he was vice president under Barack Obama — quietly working indirectly with the Iranians toward a deal that later can be brought to the table.

But much of whatever U.S. policy the Biden administration planned for the Middle East — including — has been upended by the Israel-Hamas war.

Meanwhile, the real wildcard for Iran comes on Nov. 5, when the U.S. holds its presidential election. Biden's reelection likely would see a continuation of the carrot-stick approach wielded so far during his term. If Trump is reelected, it could portend more discussions about a deal while also carrying risks. Trump in 2020 launched a drone strike that killed Iranian in Baghdad while still insisting he wanted a deal with Tehran.

A war between Israel and Lebanon — or Yemen's — also could drastically upend calculations in both Tehran and Washington.

For now though, Iran and the U.S. remain intertwined in tensions, much like they have for decades.

___

, the news director for the Gulf and Iran for The Associated Press, has reported from each of the Gulf Cooperation Council countries, Iran and other locations across the world since joining the AP in 2006.

ϲʹ. All rights reserved.