Smoke billowing from the burning city of Abadan, Iran, in 1980, during Iran-Iraq war. Photograph by AFP / Getty

The historic nuclear diplomacy taking place in Vienna’s elegant Coburg Palace has roots in a gritty war between Iran and Iraq that ended more than a quarter of a century ago. Iran suffered more than a hundred and fifty thousand dead between 1980 and 1988. In Tehran, it’s called the Sacred Defense. In the final stages, U.S. aid to Iraq contributed to Iran’s decision to pursue nuclear capability—the very program that six world powers are now negotiating to contain.

Back in the eighties, Western intelligence agencies questioned whether Iran’s eighteen-month-old revolution could survive for even a few weeks after Saddam Hussein’s surprise invasion. Tehran scrambled to mobilize remnants of the Shah’s army, the new Revolutionary Guards, and almost anyone, of any age, for a volunteer paramilitary. Tehran’s Holy Defense Museum has pictures of thirteen-year-old kids and eighty-year-old men who signed up. (Three per cent of the dead were fourteen or younger.)

Instead, the war dragged on for eight years. Most of the top Iranian officials in power today either fought in this grisliest of modern Middle East conflicts or were in key political positions trying to keep the country going.

In the end, Iran couldn’t hold off the Iraqis, especially after the United States, along with France, Egypt, Jordan, and Iraq’s other longtime arms suppliers and allies started to aid Saddam. In 1988, for the final big Iraqi offensive, the Reagan Administration spent months advising Baghdad on how to retake the strategic Faw Peninsula, where the Shatt al Arab waterway flows into the Persian Gulf. (The war was originally over which country controlled the Shatt.)

Officially, the United States was neutral. But Washington did not want Iran to win, so U.S. intelligence provided satellite imagery of Iranian positions to Iraq, along with military options. With American and other foreign guidance, the Iraqis constructed a replica of Faw for practice runs.

Iraq also used U.S. intelligence to unleash chemical weapons against the Iranians in Faw. U.N. weapons inspectors documented Iraq’s repeated use of both mustard gas and nerve agents between 1983 and 1988. Washington opted to ignore it. At Faw, thousands of Iranians died. Syringes were littered next to bodies, a U.S. intelligence source told me; Iranian forces had tried to inject themselves with antidotes. The battle lasted only thirty-six hours; it was Iraq’s biggest gain in more than seven years. The war ended four months later, when Iran agreed to a cease-fire.

A U.N. report said that Iraq dropped almost twenty thousand chemical bombs over the course of six years. It also fired more than fifty-four thousand chemical artillery shells and twenty-seven thousand short-range chemical rockets. Almost two-thirds were used during the final eighteen months of the conflict. U.S. intelligence estimated, at the time, that Iran suffered more than fifty thousand casualties—deaths and injuries--from Iraq’s use of nerve agents and toxic gases. A senior Reagan Administration official told me that he was ashamed of the covert U.S. role at Faw and during the final period of the war.

Iranian officials told me that the theocracy debated countering Iraq with chemical weapons, but opted against it. However, aware that Baghdad had a nuclear-weapons program, Iran decided to resume the nuclear research-and-development program initiated by the Shah. After the war, Tehran decided to keep it. By 2013, when the world’s six major powers launched the current diplomatic initiative, Western intelligence estimated that the Islamic Republic had the capability to build a bomb within months.

The Iraq war still haunts Iran—and shapes the theocracy’s positions at the negotiating table—partly because tens of thousands are still dying from chemical weapons, according to the Society for Chemical Weapons Victims Support. Years after the war ended, Iranian doctors noticed a pattern of patients reporting chronic pulmonary, skin, and corneal conditions associated with mustard gas. They were diagnosed with what is now known as low-dose exposure.

Last month, I went to the Tehran Peace Museum, which chronicles the largest use of chemical weapons since the First World War. Classes of schoolchildren and university students tour the museum almost every day, its director told me. One of the docents is Asad Mohammadi, who was gassed in 1986. He now has stents in his air pipes to help him breathe. He pulled out photos of the procedure to show me.

In 2013, I visited a war veteran named Ahmad Zangiabadi at his small Tehran apartment. He was no longer mobile. His lungs were failing. “Life has become a prison,” he told me. He was sleeping upright on the floor, because getting up and down was too much for his lungs and heart. He was kept alive with the help of a noisy machine that pumped medicine and air into his body. Despite two corneal transplants, he had limited vision.

He recalled, between gasps, the 1985 Iraqi air strike on the southern Majnoon Islands. He was nineteen at the time and a volunteer. “I remember the smell, the mix of garlic and fresh vegetables, boiled vegetables,” he said. “The second time, it smelled so good I wanted to breathe deeply.” The pungent odors of garlic, vegetables, and freshly mown grass are telltale signs of mustard gas. Within hours, his skin blistered, his eyes burned until he went blind, and he suffered nausea and vomiting until he passed out. He was in a coma for forty days.

Last November, I received an e-mail from Zangiabadi’s doctor reporting his death. More than seventy thousand registered victims of chemical weapons are now receiving medical care, doctors and specialists told me. In 2013, I visited several patients in a special ward for victims at the former American Hospital in Tehran. One patient told me, “One of my wishes is to be able to take a deep breath again.”

During my recent visit, Iran was gripped by news that the bodies of a hundred and seventy-five military divers had been recovered in Iraq—three decades after their capture by Saddam Hussein’s forces. The men had reportedly been buried alive after their wrists were tied together with wire. Tehran released gruesome pictures of the recovery, and of the decayed and bound corpses still dressed in diving gear.

The country was consumed with mourning yet again—even young people, born after the war ended, were deeply moved. The hashtags #175 and #hand-tied were all over Twitter. Images created to show solidarity sped across (http://en.mehrnews.com/news/107555/Return-of-175-martyr-divers-agitates-grievous-memories-in-Iran), many of them variations of clenched fists, tied together, in the air. In mid-June, hundreds of thousands of people turned out for the procession of the divers’ flag-draped coffins through Tehran.

“The divers were the bravest of us,” Mohsen Rezai, who commanded the Revolutionary Guards during the war, told the crowd. “They gave their lives for the independence of our country and the success of our revolution.” As the country’s diplomats prepared to return to Vienna for the nuclear talks, he declared, “Iran's enemies stood by Saddam for the whole eight years of the Sacred Defense.” It was clear that he included the United States among them.