Iran can no longer downplay its intervention in Syria’s civil war; there are too many public funerals these days. Two generals were killed in action this month. So was a senior bodyguard of former President Mahmoud Ahmadinejad. In recent weeks, senior Revolutionary Guards commanders—advertised as “military advisers”—have died on three separate fronts.

The human cost of Iran’s intervention in Syria, on behalf of President Bashar al-Assad, started small, and with little notice. The first to die were young paramilitary fighters. I learned of one of the early casualties in December, 2013, when I visited Zahra’s Paradise, the largest cemetery in Tehran. It sprawls across many blocks. One section is devoted to martyrs killed during the devastating eight-year war with Iraq, in the nineteen-eighties. Iran’s Shiites revere the dead, especially their martyrs, so the cemetery is a good place to gauge public opinion. Among the old tombstones, and the families picnicking among them, I found a new grave. It had been squeezed in, next to a sidewalk. The red rose petals strewn across it, and the yellow flowers that neatly circled it, were fresh. A picture identified the man buried there as a martyr, Mohammad Hassan Khalili, a twenty-seven-year-old with dark hair and light facial stubble. An Iranian flag had been draped over the temporary headstone. A banner said that he belonged to a paramilitary wing of the Revolutionary Guards called the Basij. He died protecting the Tomb of Zaynab, a site of pilgrimages to honor the granddaughter of the Prophet Muhammad, one of Shiism’s early heroines. It’s on the outskirts of Damascus.

Mohammad Hassan Khalili’s grave. Photograph courtesy Robin Wright

The Islamic Republic described the first men to die as a few young “volunteers” deployed to protect symbols of the faith. The numbers have escalated since then. In June, the Islamic Republic News Agency reported that more than four hundred volunteers from Iran, including Afghan refugees living in the country, had died in Syria so far. Iranian news agencies and social media are now rife with stories about senior officers killed in Syria on the war’s toughest front lines. Last week, Iran’s Fars News Agency reported that the death toll hit eight in just two days. The funerals have become major events, sometimes drawing thousands onto Tehran’s streets to escort the coffins to Zahra’s Paradise.

Iran has increasingly been forced to acknowledge its losses—including at least four generals in the past year—with some reports suggesting that twice that number have been killed since the intervention began. Brigadier General Hossein Hamedani, who was killed on October 8th, was given a state funeral. Iran’s Supreme Leader, Ayatollah Ali Khamenei, personally called on Hamedani’s family to convey his condolences. Khamenei’s official Twitter account, in English, lauded the general for fulfilling his “martyrdom wish.”

Hamedani’s death was a setback for Iran—and possibly for Syria, too. According to Jane’s Defense Weekly, Syria’s regular Army has been halved since the war began, in 2011. Assad has increasingly relied on leaders in Iran to develop strategy, and counted on Hezbollah, Iran’s proxy force in Lebanon, to provide new fighters. Hamedani was the senior Iranian tactician in northern Syria, where the regime is simultaneously fighting Western-backed rebels, the Islamic State, a local Al Qaeda franchise, and smaller militias. Hamedani was a hero of the war with Iraq—the deadliest modern conflict in the Middle East—and his death was the most notable Iranian military loss since that war ended.

Iran has provided few details about any of the deaths. But the locations, in three different parts of Syria, offer insight into the scope of Iran’s intervention. General Hamedani was killed on the outskirts of Aleppo, which is Syria’s largest city, its commercial center, and, today, the war's most important front line. On October 13th, two Revolutionary Guards commanders, both colonels, died in southern Syria, Iranian news agencies reported. On October 22nd, Brigadier General Reza Khavari died in clashes around Hama, in central Syria. Earlier this year, in January, Brigadier General Mohammad Ali Allahdadi was killed, along with six Hezbollah fighters, when an Israeli air strike hit southern Quneitra. In February, 2013, Revolutionary Guards Brigadier General Hassan Shateri was assassinated in the vicinity of Syria’s western border with Lebanon. Tehran blamed “agents and supporters of the Zionist regime.”

The Iranians are dying in gun battles, not just on the sidelines or while protecting religious shrines. This month, a senior commander in the Basij, Nader Hamid, died of gunshot wounds suffered in a battle around Quneitra. He was reportedly coördinating a campaign by Hezbollah and a Syrian militia against Western-backed rebels. In April, Major General Hadi Kajbaf and three other Iranians died fighting rebels sixty miles south of Damascus.

Iran has been sucked deeper into the Syrian conflict in phases. As a longtime ally of the Assad dynasty, which has ruled Syria for decades, Iran has provided military advisers and billions of dollars in arms and aid. Iran came to Assad’s rescue after an uprising, sparked by protests among teen-agers, erupted in 2011. Tehran increased its support as tensions disintegrated into a civil war over the next year. It urged and facilitated the deployment of Lebanon’s Hezbollah militia, which has often fought more effectively than Syria’s Army. In 2013, Iran’s élite Quds Force helped organize the new paramilitary National Defense Forces, which now total at least seventy thousand, to supplement Assad’s weakened Army.

Iran’s aid has increased since the Islamic State, the Nusra Front, and other Sunni extremists began seizing large areas of Syria and Iraq, in mid-2014. Over the past month, hundreds of additional Iranian “advisers” have reportedly gone to Syria. Middle East media outlets claim that General Qassem Suleimani, the renowned commander of the Quds Force, arrived in Syria this month to mobilize a new offensive around Aleppo. The growing Iranian ground presence has coincided with Russia’s new bombing campaign by air.

Like the Russians, Iran claims that the Syrian war is technically not winnable. “There is no military solution in Syria,” Iran’s foreign minister, Mohammad Javad Zarif, told me last month, when he was in New York to attend the U.N. General Assembly. “At the end of the day, everybody has to negotiate. And I think everybody understands this. There has to be a political solution to Syria, everybody committed to a political solution. The military battleground has its ups and downs. But the military battles alone will not determine the future of Syria.”

Also like the Russians, Iran may be trying to invest in whatever comes out of Syria’s civil war, which has killed a quarter of a million people and displaced more than half of Syria’s population of twenty-three million. The government in Damascus has been the most important Arab ally for both Tehran (since the 1979 revolution) and Moscow (since the nineteen-fifties). Syria has few natural resources, but its geography—bordering Israel, Jordan, Iraq, Turkey, Lebanon, and the Mediterranean—makes it the strategic center of the Middle East.

Iran claims its plan is to retrieve territory and weaken both Western-backed rebels and extremist militias, and then to deal with the political crisis that sparked the war. In New York last month, at a meeting with members of American think tanks that I attended, Iranian President Hassan Rouhani said that “combatting and defeating terrorism” was Tehran’s first priority. He went on, “After that, we can pursue political reforms vis-à-vis the Syrian government—reforms that must take place through whichever channel or pathway. There are many channels through which to conduct those reforms. We can work together.”

In London, last week, Deputy Foreign Minister Hossein Amir-Abdollahian conceded that Iran has boosted its military presence in Syria. At the same time, he said publicly what other officials have said privately for more than a year—that Iran is not wedded to President Assad in the long term. "We are not working for Assad to stay in power forever as president,” he told the Guardian. “But we are very cognizant of his role in the fight against terrorism and the national unity of that country. The people of Syria will make the final decision—and whatever decision they take, we will endorse." In the meantime, the death toll rises for all involved.