Open this photo in gallery:

A protester holds a portrait of Iran’s Supreme Leader Ayatollah Ali Khamenei during a protest against U.S. and Israeli attacks.Hadi Mizban/The Associated Press

A cleric and a revolutionary, a lover of poetry who oversaw a decades-long nuclear program and directed the death of many thousands of his own citizens, Ayatollah Ali Khamenei made the Islamic Republic of Iran into a global cornerstone of defiance and violence.

Born in 1939 into a poor family in northeastern Iran, Khamenei became the country’s second supreme leader in 1989 a decade after the Iranian revolution brought Islamists to power in the oil-rich country. In nearly 37 years in power, he built a fearsome apparatus of state repression and military aggression, funding violent Islamist proxies in Lebanon, Syria, Yemen and Palestinian territories and supplying potent weaponry to allies like Russia, all while enforcing a strict religious orthodoxy at home.

His doctrine of “strategic patience” – an approach described as the pursuit of neither war nor peace – brought decades of instability to the Middle East, as his regime menaced Israel, chanted “Death to America” and openly sponsored organs of regional terror.

He was “one of the most evil people in History,” U.S. President Donald Trump wrote on social media Saturday, corroborating Israeli reports of Khamenei’s death. The death of the ayatollah, 86, was confirmed by state media.

Khamenei pursued religious studies in a country ruled by a monarch, Reza Shah Pahlavi, who worked closely alongside the U.S., cooperating with Washington against the Soviet Union and its Arab allies. Persian intelligence officers were trained by the CIA; the Shah acceded to American pressure to release political prisoners.

In 1962, Khamenei began to study under Ruhollah Khomeini, the influential Shiite cleric who accused the Shah of surrendering Iranian sovereignty.

Khomeini became Iran’s first supreme leader following the Islamic revolution in 1979 that drove the Shah from the Peacock Throne. Khomeini’s seizure of power brought theocratic rule to Iran, bloodied from its early days by the execution of Shah loyalists. A rewritten constitution gave the supreme leader unquestioned power, including the ability to point leaders for the country’s military and judiciary.

From the outset, Khamenei stood at Khomeini’s side, becoming part of the Revolutionary Council in 1979. A bomb attack in 1981 paralyzed his right arm, but did little to halt Khamenei’s advancement. He served as deputy defence minister and played a role in the organization of the Islamic Revolution Guard Corps, which Canada and others have recently designated as a terrorist entity. He spent eight years as president, until the death of Khomeini in 1989, when he was named successor.

Khamenei’s elevation to supreme religious leader was met with skepticism about his ability to uphold the revolution his once-teacher had begun. Seen as a relatively junior cleric, doubters questioned Khamenei’s ability to effectively operate the levers of power in a state riven by ideological and religious differences. At the outset, he was seen as leader of a caretaker administration.

But he moved quickly to elevate religious hardliners, undercutting economic reform efforts, sidelining elected leaders to assert his own priorities in affairs of the state and, over the span of many protests and elections, crushing those who threatened his rule.

In 2000, Ayatollah Ali Meshkini, head of the country’s Assembly of Experts, described Khamenei’s powers as ”absolute,” and “subject to no conditions of any kind, and popular elections have no influence on the matter.”

Over the years, Khamenei shuttered critical media outlets and killed a law to promote press freedom; purged “un-Islamic” elements from universities; jailed artists, intellectuals and a Nobel Peace laureate; arrested and kidnapped foreigners; severing communication services when protest movements swelled; and gunning down protesters. In January, security forces massacred civilians who had participated in anti-government protests. Human rights groups estimate that the dead number in the tens of thousands. Khamenei had said demonstrators, some of whom had chanted “Death to the dictator!” should “be put in their place.”

He insisted on a strict adherence to conservative Islamic principle, even banning women from riding bicycles, saying they “must avoid anything that attracts strangers.”

Khamenei called Israel a “cancer” growing in the midst of Islamic nations and, throughout his rule, pitted his regime against the U.S., which he in 1993 called ”the dictatorship which the Muslim Iranian nation drove out from its home with empty hands.”

For Khamenei, the U.S. represented not merely a much better armed military rival, but a profound cultural threat to the theocracy he sought to maintain. He rejected overtures from then-President Barack Obama and resisted nuclear talks with Donald Trump’s administration, after Mr. Trump pulled out of an earlier deal in 2018.

After the U.S. struck a series of Iranian nuclear sites with bunker-busting bombs last June, Mr. Trump said that attack, dubbed Operation Midnight Hammer, had “obliterated” key components of the Iranian nuclear program.

Khamenei dismissed the bombing as having failed to “accomplish anything significant.”

But the apparent failure of Iran’s defensive systems to block U.S. bombers underscored a broader weakening of the Iranian regime. In years of war, Israel had already removed much of the threat Tehran was once able to wield through heavily-armed proxies like Hezbollah and Hamas. That war was provoked by the deadly Hamas-led attack on Oct. 7, 2023.

On Saturday, Mr. Trump called the death of Khamenei “not only Justice for the people of Iran, but for all Great Americans, and those people from many Countries throughout the World, that have been killed or mutilated by Khamenei and his gang of bloodthirsty THUGS.”

Reza Pahlavi, the son of the late shah, wrote on X that with Khamenei’s death, “the Islamic Republic has effectively come to an end and will soon be consigned to the dustbin of history.”

But Khamenei himself remained defiant until the end.

Last week, he dismissed the military armada that Mr. Trump had ordered to waters near Iran, saying American warships “could be sunk to the bottom of the sea,” warning that “the strongest army in the world may receive a slap it cannot recover from.”

He added: “A nation like us – a nation with this culture, this history, and these lofty teachings – will never pledge allegiance to leaders like the corrupt people who are in power in the United States today.”