BEIRUT (AP) — In demonstrations across Iran, chants are going up against the military’s vast and shadowy war in Syria, one of Tehran’s closest allies and a frontline state in its confrontation with its archenemy, Israel.

Although the protests have focused on economic issues, demonstrators have also voiced strong opposition to the government’s policy of sending young Iranians to fight and die in Syria while spending billions of dollars on the military when they say the priority should be working to provide jobs in Iran and control the rising cost of living.

Their slogans include, “Leave Syria, think about us!” and “Death to Hezbollah!” the Iranian-backed Lebanese militant group that has been a key instrument of Tehran in Syria’s war.

Syria saw its own domestic demonstrations morph into anti-government protests in 2011. They were met with a brutal crackdown by President Bashar Assad’s security services, sending the country into civil war.

But as cracks appeared in Assad’s military, with soldiers refusing to fire on protesters and defecting to the opposition, Iran and later Russia stepped in to support their ally.

Iran’s theocratic leadership has cast the effort as a religious war for Shiite Islam, an epochal struggle to defend the shrine of the Prophet Muhammad’s daughter in Damascus from Sunni jihadis, and to deal a crippling blow to what it says is a U.S.-Israeli conspiracy to destroy Syria. But it is motivated by geopolitical concerns, too. Syria, bordering both Israel and Lebanon, is a key node to Iran’s network of deterrence against Israel.

Tehran needs Damascus as both a conduit to and sponsor of Hezbollah, Iran’s vanguard force in the region.

Today, Iran’s military and an array of regional militias under its command operate with wide latitude in the war against rebels and Islamic State militants in both Syria and Iraq. It is also invested in the Gaza Strip and is accused of supporting Shiite rebels in Yemen.

___

MILITARY SACRIFICE

Across Iran, banners honoring the young men who have died fighting in Syria hang over public spaces as a reminder of the sacrifice that has been paid.

Imams memorialize the dead at Friday prayers, and media outlets pay tribute to the “martyrs” who have died “defending the holy shrine” of Muhammad’s daughter, Sayyida Zeinab, in the Syrian capital.

In September, Iran’s supreme leader, Ayatollah Ali Khamenei, prayed over the casket of 25-year-old Mohsen Hojaji at a funeral broadcast nationwide, followed by a large rally in Tehran — moves crafted to stir patriotism in a country growing weary of the military venture in Syria. An image of Hojaji depicted him being welcomed into heaven by the third Shiite saint, Hussein, Muhammad’s grandson.

Iran has not disclosed how many of its soldiers have been lost in Syria, but Mohammad Ali Shahidi, the head of the Martyr’s Foundation of the Islamic Revolution, which supports veterans and families of the dead, says more than 2,000 men have been killed, though roughly half of those are foreigners from Afghanistan and other nations fighting under militias organized by Tehran.

In November, the semi-official Fars news agency reported the death of an Iranian brigadier general in Boukamal, a Syrian town overlooking one of the country’s main crossings into Iran. Fars said the general was killed by a mortar shell in a battle with Islamic State militants.

That same battle was directed by the Iranian Revolutionary Guard Corps’ own Maj. Gen. Qassem Soleimani, who was shown in videos published on social media addressing fighters in Farsi. He had under his command Shiite fighters from Hezbollah and Iraq’s Popular Mobilization Forces’ militias, as well as Syrian army forces and Iran’s Revolutionary Guard.

Syrian rebels say the Revolutionary Guard has directed several major battles on behalf of Assad’s forces and has bases from the south of the country to the north.

Iran spends more than $12 billion annually on its military, according to the Stockholm International Peace Research Institute. It is understood to spend millions more on subsidies and exports to Syria, which has seen its economy shattered by the war.

The protests now shaking Iran erupted after President Hassan Rouhani’s latest budget proposal disclosed cuts to local subsidies while preserving privileges for the military and religious institutions.

___

HEZBOLLAH AND OTHERS

Iran and Assad have depended on Hezbollah to do some of the toughest, special forces assignments in the Syrian war. But Tehran has also organized militias from Afghanistan, called the Fatimiyoun, and Pakistan, called the Zeynabiyoun, to fight in Syria. It promises Afghan refugees living in Iran wages and citizenship in exchange for a tour of duty in Syria.

Syrian rebels say they are battling not just Syrian government soldiers, but Lebanese, Iraqi, and Afghani fighters, too. And Associated Press reporters have seen the flags of Afghan and Lebanese militias flying over military points outside Aleppo, Syria’s largest city.

Syria’s rebels, boosted by calls for global jihad, are supported by scores of foreign fighters of their own.

Human Rights Watch says Iran’s Revolutionary Guard has recruited Afghan refugee children as young as 14 to fight in Syria, identifiable by their tombstones in Iran. It says Iranian media memorialized child soldiers and hailed Iranian fighters as young as 13 in the Syria battle.

Iran also leans heavily on the battle-hardened fighters of Iraq’s state-sanctioned Popular Mobilization Forces, which has been instrumental to defeating Islamic State militants on both sides of the Syria-Iraq border and opening a corridor of Iranian influence that runs from Tehran to Baghdad to Damascus to Beirut.

As in Iran, there is a risk in Lebanon and Iraq of popular blowback against a grinding military effort in Syria that has stretched on for nearly seven years.

When Lebanese authorities pulled down illegal vendor stalls in a Hezbollah stronghold in south Beirut in October, residents took to the streets to excoriate Hezbollah’s leadership for failing to stand up for them, despite their sacrifices over Syria.

“They should be planting a tree on each martyr’s grave,” a woman shouted to the cameras. “Every home has a martyr. Every home has a wounded veteran.”

___

Associated Press writer Nasser Karimi in Tehran, Iran, contributed to this report.