Iran’s President arrived in New York City in September and left, as usual, without meeting the American one. Both Hassan Rouhani and Donald Trump professed an appetite for sitting down and talking over the ever more treacherous rift between their nations. But as Rouhani has pointed out in private, Iran’s top elected official “has no authority in foreign policy.” That authority–and nearly every other strand of power in the Islamic Republic–resides with the elderly cleric who remained 6,000 miles away, in the country he has not left for decades.

Ayatollah Ali Khamenei, 80 years of age, disabled by a saboteur’s bomb blast and lit by a righteous certainty, holds the title of Supreme Leader of Iran. But he has quietly emerged as the most powerful person in the Middle East, with uniformed military fighting in Syria and loyal proxies dominant in Lebanon, Yemen and (despite a U.S. investment of $1 trillion and thousands of lives) Iraq. Since the spring, behind a thin veil of denials, he has also presided over an audacious and escalating campaign to raise uncertainty and global oil prices, shooting down a $176 million U.S. drone, blowing holes in tankers and bombing the heart of Saudi Arabia’s oil production, all without drawing a U.S. military response.

Khamenei, who has confounded every U.S. President he has faced since coming to power 30 years ago, harbors a particular animus for Trump. In June, he told the Prime Minister of Japan, who had come bearing a message from the White House, “I do not consider Trump as a person worth exchanging any message with.” A detonation on the hull of a Japanese oil tanker the same day might have been an exclamation point.

Portraits of Khamenei and his mentor and predecessor, Khomeini (right), at a Tehran polling place in June A. Abbas—Magnum Photos

Perhaps no other foreign leader is working harder to put Trump out of office than Khamenei. And perhaps no other foreign leader differs in more ways. Trump, thrice married and irreligious, has lived a life of opulence and publicity. The deeply devout Khamenei has been married for over 55 years, and he openly disdains pomp and materialism. Trump, operating on impulse, exhibits no organizing principles. Khamenei has shown a lifelong commitment to his: resistance against “global arrogance”–his moniker for American imperialism–is both ideology and strategic doctrine for the theocracy. When Trump unilaterally withdrew the U.S. from the 2015 deal that had significantly curtailed Iran’s nuclear program, the move validated Khamenei’s view of the U.S. as “deceitful, untrustworthy and backstabbing.” The sanctions Trump then imposed have further debilitated Iran’s economy, sending it to 50% inflation. But they seemingly stiffened Khamenei’s resolve. “Resistance,” Khamenei said in a recent speech that included the word 70 times, “unlike surrender, leads to the retreat of the enemy.”

In Trump, Iran has an enemy who does not want to fight. After an Iranian missile shot down that massive U.S. drone in June, Trump at the last minute retracted his own order for military retaliation. Two days later, he thanked Iran for not shooting down a manned flight: “That’s something we really appreciate.” The vacillation seems to have only increased Khamenei’s appetite for risk, and on Sept. 14, Saudi Arabia’s largest oil facility was crippled by a missile and drone attack.

Iran denied involvement, but the game unfolding now is one Khamenei knows well. For years, he has carefully calibrated Iran’s reaction to U.S. pressure: an insufficient response might project weakness and invite more pressure. An excessive response, on the other hand, could trigger a serious U.S. retaliation and risk outright war. It’s a situation made even less predictable by two qualities the leaders do share: each harbors an appetite for conspiracy theories and a profound sense of victimization.

Illustration by Hellovon for TIME

Khamenei is a geriatric cleric ruling over an increasingly secular population whose median age is 30. Aside from Syria’s Bashar Assad, he has no reliable friends in the world. And he goes to bed every night and wakes every morning believing that the U.S. government is actively trying to overthrow him. This paranoia–frequently reflected in official state media, which Khamenei controls–is also driven by political expediency. Mohammed Khatami, the reformist cleric who was Iran’s President for two terms (1997–2005), told me in a private meeting in Oslo in 2008 that when he was in office Khamenei used to tell him that Iran “needs enmity with the United States. The revolution needs enmity with the United States.”

Despite its distance and a military budget less than 3% of that of the U.S., Iran has loomed large in American domestic politics. The Iran hostage crisis ended Jimmy Carter’s presidency; Iran-contra tainted Ronald Reagan’s presidency; Iranian machinations in post-Saddam Iraq exhausted George W. Bush’s presidency. And the Iran nuclear program and negotiations engrossed the Obama presidency.

Trump inherited from Obama an Iran that resembled the late-stage USSR, powerful beyond its borders but hemorrhaging billions of dollars in foreign entanglements and mired by internal economic malaise and ideological fatigue. But instead of marshaling global unity against Tehran’s malign activities, Trump abandoned the nuclear agreement the U.N. reported Iran had been adhering to.

To this day, senior U.S. government officials confuse Khamenei with his charismatic predecessor: Grand Ayatollah Ruhollah Khomeini, the founder of the Islamic Republic. Although Khomeini died 30 years ago, his sinister daily presence on American TV sets through the 444-day hostage crisis left a lasting impression. “These economic sanctions are just a part of the U.S. government’s total effort to change the behavior of the Ayatollah Khomeini,” Secretary of State Mike Pompeo said in a November 2018 briefing. “The assets of Ayatollah Khomeini and his office,” President Trump followed up in June 2019, “will not be spared from the sanctions.”

The confusion–like so much the U.S. does–may serve Khamenei. He prefers to obscure his vast power behind the Islamic Republic’s byzantine array of institutions. The Assembly of Experts, Guardian Council, Expediency Council and Revolutionary Guards evoke a Game of Thrones–style drama. But in reality they are all led by individuals handpicked by Khamenei or unfailingly loyal to him. They serve to buttress rather than check his authority.

Khamenei is a reader. He has frequently said Victor Hugo’s Les Misérables is the greatest novel ever written, and his Instagram feed shows him smiling as he reads a Persian translation of Fire and Fury, Michael Wolff’s unflattering account of Trump’s first year in office. And though it’s unknown whether he’s read The Prince, he displays a Machiavellian genius in manipulating what Iranians call “the system.” Khamenei’s slyest feat: assuring that he has power without accountability, while Iran’s elected Presidents have accountability without power.

Iran makes a great show of its highly manipulated presidential elections, and their importance to the public became clear when the 2009 ballot was stolen. Millions took to the streets in what became known as the Green Movement, brutally quashed by the leader’s internal militia, the Basij. Marring the ballot was a dangerous miscalculation by Khamenei, and perhaps an unnecessary one. No matter the challenge brought by a President–the economic challenge of Hashemi Rafsanjani (1989–1997), the democratic challenge of Khatami, the populist challenge of Mahmoud Ahmadinejad (2005–2013) or the pragmatic one of Rouhani (2013–present)–Khamenei emasculated each. In more than two decades researching Iran, both in Tehran and the U.S., I have learned the most important indicator of the regime’s behavior is in the speeches of the Supreme Leader.

In 1980, Khamenei visited American hostages inside the captured U.S. embassy A. Abbas—Magnum Photos

Khamenei projects a life of piety and service. He hasn’t left the nation since 1989 and, apart from a small, trusted coterie of advisers, is largely inaccessible. His modest official residence in working-class central Tehran is hidden from the public, and his clothing usually consists of dull robes and cheap slippers. Visitors to Khamenei’s abode curry favor with him by publicly recounting its simple decor and plain dinner menu, often bread, cheese and eggs.

Among his two daughters and four sons (all of whom became clerics) only one, Mojtaba, has a public profile. And in contrast to Arab first ladies whose spendthrift ways have fueled popular anger, Mrs. Khamenei has never been seen in photographs. Still, the facade was pierced by a 2013 Reuters investigative report that revealed Khamenei controls a $95 billion financial conglomerate, which he uses as he wishes. The conglomerate was built on the seizure of property of Iranians, many of them religious minorities, and holds stakes in sectors as diverse as oil, telecommunications, the production of birth control pills and ostrich farming.

But if Khamenei controls more billions than Trump ever claimed to, his origin story is both humbler and bloodier. The second of eight children born to a Shi’ite cleric father in the shrine city of Mashhad, Khamenei has often romanticized his deprived but devout upbringing, saying he frequently ate “bread and raisins” for dinner. He was enrolled in religious education by age 5 and recalls entering “the arena of jihad” as a teenager, inspired by a radical Shi’ite cleric complicit in the assassination of several prominent Iranian secular intellectuals and government officials in the 1950s. While studying in Qom–the Shi’ite Vatican–in his early 20s, Khamenei came under the tutelage of Khomeini, who became his lifelong mentor.

At the time, Khomeini was largely unknown in Iran, but his opposition to the social reforms–particularly women’s enfranchisement–and modern pretensions of Iran’s ruling monarch, Shah Mohammed Reza Pahlavi, gained him a loyal following among deeply traditional seminary students. When the Shah exiled Khomeini in 1963, Khamenei remained in Iran disseminating his mentor’s unorthodox teachings about Islamic government. Because that theocratic doctrine cast the West as a foil to the virtue of fundamentalist Islam, it made common cause with Iran’s anti-imperialist liberal intelligentsia, who resented American meddling in Iran. Traumas in Khamenei’s personal history also shape his worldview. While working underground, he was repeatedly arrested for his antigovernment agitations by the Shah’s secret police (SAVAK) and endured torture and solitary confinement. Those who know Khamenei personally have speculated that the roots of his hatred toward Israel and the U.S. go back to this period, since SAVAK was widely believed to have received assistance from the CIA and Mossad.

When Grand Ayatollah Khomeini returned in triumph in 1979, having overthrown the Shah, his disciple was catapulted from anonymity. Khamenei was delivering a speech on June 27, 1981, in a Tehran mosque, when a bomb hidden in a tape recorder exploded. According to his official website, “The right side of his body was full of shrapnel and pieces of radio.” Khamenei’s right hand was no longer functional. “I won’t need the hand,” he claims to have replied. “It would suffice if my brain and tongue work.” Since then he has been forced to do everything, include write, with his left hand. An Islamic Republic political insider once told me Khamenei’s contempt for his opponents is refreshed every morning “when he struggles to wash his ass with one hand.”

The cultlike Marxist-Islamist organization that was blamed for the bomb, the Mujahedin-e-Khalq, now promotes regime change from exile. It has minimal support but deep pockets and has together paid Trump associates John Bolton and Rudy Giuliani hundreds of thousands of dollars in speaking fees.

Recovering in a Tehran hospital from a 1981 bomb blast that cost him the use of his right hand Afarsi.Khamenei.ir

Khamenei became an Ayatollah by shortcut. When Khomeini died in 1989, shortly after agreeing to a cease-fire to end the brutal eight-year war with Iraq, there was no clear successor. Then speaker of the parliament Rafsanjani claimed that Khomeini’s dying wish was for Khamenei to succeed him, and made it happen. “I am an individual with many faults and shortcomings,” Khamenei said in his inaugural speech, “and truly a minor seminarian.” In the demanding hierarchy of Shi’ite Islam, he had the clerical equivalent of a master’s degree (hojjat al-Eslam).

He was made an Ayatollah overnight, but, lacking the respect of the seminary, instead sought the legitimacy of the barracks. Khamenei cultivated the Islamic Revolutionary Guards Corps (IRGC), selecting its top cadres, and shuffling them every several years to prevent them from establishing independent power bases. The checkered IRGC scarf Khamenei wears around his neck signals a symbiotic relationship: politically expedient for Khamenei and financially expedient for the Guards, who have become a dominant economic force in the theocracy they defend. Between banking, construction, smuggling and other nebulous enterprises, the IRGC, one study estimates, now accounts for one-third of the Iranian economy.

Iran, which is publicly edging toward resuming its nuclear program, will likely always want to be a screwdriver turn away from having atomic weapons. But for now it has been doing well without them. Khamenei is likely the only leader in today’s Middle East who can inspire people, many of whom are not even Iranian citizens, to go out and kill–and potentially die–for him. It’s a major reason Iran’s regional proxies have consistently outmatched their opponents, as the Islamic Republic moved to exploit the opportunities created by the U.S. in Iraq and the power vacuums created by the Arab uprisings. The Arab countries in which Tehran wields the most influence–Syria, Iraq, Lebanon and Yemen–are engulfed in civil strife and ruled by weak, embattled central governments.

Khamenei and Qasem Soleimani flank Iraqi cleric Muqtada al-Sadr at a Tehran mourning ceremony on Sept. 10 Office of the Iranian Supreme Leader/AP

At the same time, Iran is the only nation in the world simultaneously fighting three cold wars–with Israel, Saudi Arabia and the U.S. Khamenei manages those conflicts with two crucial tools: Qasem Soleimani, the charismatic commander of IRGC operations abroad, is Khamenei’s sword. Foreign Minister Javad Zarif, in contrast, is his shield, deflecting Western economic and political pressure. Soleimani deals with foreign armies, Zarif with foreign ministries.

And the 80 million Iranians? Khamenei has shown himself willing to subject them to indefinite economic hardship rather than hold his nose, swallow his pride and do a deal with the U.S. His insensitivity–his own brother, a reformist cleric, was once beaten by a hard-liner mob–has allowed Khamenei to play a weak hand strongly. Trump, hypersensitive to his domestic political fortunes, has played a strong hand weakly.

Trump’s warm interactions with North Korean dictator Kim Jong Un are understood by Tehran as evidence that pageantry and flattery are higher priorities for the U.S. President than nuclear nonproliferation and human rights. Yet Khamenei is too proud, and dogmatic, to flatter Trump. If Tehran ever does come to the table, another difference presents new obstacles. Trump prefers public spectacles about broad topics, while Khamenei favors covert discussions on narrow ones.

But then Trump faces re-election in 13 months. Khamenei serves for life. Once again, no successor is in sight. But the shape the Islamic Republic has assumed on his watch, morphing from a clerical autocracy into a military autocracy, suggests the IRGC will play a much more overt role in Iran’s politics, on the lines of Pakistan’s or Egypt’s militaries.

For now, however, the current game of chicken between the U.S. and Iran remains a test of wills between two proud, elderly men. The consequences of their actions will long outlive both.

This appears in the October 14, 2019 issue of TIME.

Get The Brief. Sign up to receive the top stories you need to know right now. Please enter a valid email address. Sign Up Now Check the box if you do not wish to receive promotional offers via email from TIME. You can unsubscribe at any time. By signing up you are agreeing to our Terms of Use and Privacy Policy . This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply. Thank you! For your security, we've sent a confirmation email to the address you entered. Click the link to confirm your subscription and begin receiving our newsletters. If you don't get the confirmation within 10 minutes, please check your spam folder.

Contact us at letters@time.com.