Members of Hezbollah attend the funeral of a Hezbollah fighter Tuesday in Sarafand, Lebanon. The fighter was killed in combat alongside Syrian government forces. (Mahmoud Zayyat/Agence France-Presse via Getty Images)

Forces battling for control of three Syrian towns were observing a temporary cease-fire Thursday after a push by Iran to explore diplomatic solutions to end Syria’s civil war.

The truce, which began Wednesday in the strategically important western hub of Zabadani and two northwestern towns, was a product of weeks of talks in Turkey between Iranian officials and Ahrar al-Sham, a Syrian rebel group, according to rebels and a former Syrian diplomat. Initially set to last 48 hours, the cease-fire was extended Thursday for an additional two days, the Associated Press reported.

Iran negotiated on behalf of President Bashar al-Assad’s government, whose forces — along with Lebanon’s Hezbollah militia — have been besieging rebel-held Zabadani since July 5. The government’s absence from the talks highlights the scope of Tehran’s influence over its ally, said Bassam Barabandi, the former diplomat, who is familiar with the exchanges.

“These negotiations with Iran show that the Iranians are calling the shots, 100 percent, in Syria,” he said.

On Wednesday, Iran’s foreign minister, Mohammad Javad Zarif, visited Syria for talks with Assad.

The unusual diplomatic initiative that led to the truce reflects fatigue among Assad’s allies amid a four-year-old conflict that has killed more than 230,000 people and displaced millions, analysts say. The government controls less than half of Syria’s territory and has lost significant ground to rebels in recent months despite receiving billions of dollars in aid from Iran and crucial battlefield support from Iranian-backed Hezbollah militiamen.

It also may reflect a growing recognition by Hezbollah and Iran that Syria’s rebels cannot be defeated militarily and, in particular, that Hezbollah cannot sustain its engagement in Syria indefinitely, according to analysts. The militant group, perhaps the most powerful in the region, has suffered significant losses­ during the standoff in Zabadani.

“As Hezbollah deaths mount, it becomes ever clearer that Shiites and Alawites are too few to hold the line against Sunni-Salafist rebel groups that are becoming ever more lethal, organized and well-armed,” said Joshua Landis, an expert on Syria and director of the University of Oklahoma’s Center for Middle East Studies.

The Assad government and its military are controlled by members of the Alawite religious group, a small minority that is an offshoot of Shiite Islam. The rebellion is led by Sunnis, who formed a large majority of Syria’s prewar population of 24 million.

Hezbollah earned its militant bona fides fighting Israel, including during a devastating war in Lebanon with the Jewish state in 2006. The group’s responsibilities expanded dramatically when its militants formally joined the fight in Syria more than two years ago. They helped Assad’s government — a key supplier of arms to Hezbollah — win back vital territory captured by rebels.

But Assad’s military has been weakened by manpower shortages, leading to the recent losses­ of territory. A coalition of Islamist rebels is seizing territory in the northwest, while relatively moderate insurgents are advancing northward from the south. The Islamic State militant group, meanwhile, is making inroads in the west from its eastern strongholds.

In Zabadani, Assad’s Hezbollah allies have faced brutal guerrilla tactics, including booby-trapped homes, roadside bombs and sniper fire. The rebels may well have taken those methods from Hezbollah’s own playbook — its fighters used guerrilla warfare to force Israel’s military to withdraw from Lebanon in 2000 after years of occupying southern areas of the country.

In the southern Qalamoun Mountains, Zabadani abuts the Lebanese border and is a key hub in Hezbollah’s supply line to Damascus, the capital, about 20 miles to the southeast. Zabadani also connects Damascus with pro-government strongholds along Syria’s northwestern coastline.

“Hezbollah is experiencing fatigue because they are fighting an urban war and having to clean the city inch by inch, which takes time and casualties,” said Elias Hanna, a retired Lebanese army general, referring to Zabadani.

Rebels say the Iranian negotiators want militants holding Zabadani to vacate the town in exchange for control over the two northwestern towns also subject to the truce, Foua and Kfarya, which have come under attack by Ahrar al-Sham and other rebel groups.

It is unclear how many Hezbollah fighters have been killed in Zabadani, but anecdotal evidence suggests the number is in the dozens. A Hezbollah spokesman declined to provide official comment.

As many as 5,000 militants from the group are fighting in Syria at any time, with hundreds and possibly more than 1,000 of them killed in the conflict, according to some estimates.

A Lebanese intelligence official said that as many as 10,000 Hezbollah fighters have been wounded in Syria. The group has had to draw heavily on reservists and young men with no battlefield experience, said the official, who spoke on the condition of anonymity because he was not authorized to discuss the topic.

Hanna, the retired general, said that “Hezbollah is forced to dig deeper into its reserves, and so when you use lower-quality soldiers, this means you no longer fight as effectively.”

Zabadani, which initially fell to rebel control in 2012, had been relatively calm after a shaky truce was reached between residents and the government. But an offensive launched in the area by Hezbollah in May appears to have driven insurgents from surrounding areas into Zabadani, which was home to about 30,000 people before Syria’s uprising started in 2011.

Hezbollah wants to rid the Lebanon-Syria border area of rebels linked to hard-line Sunni groups such as Ahrar al-Sham and the al-Qaeda-affiliated Jabhat al-Nusra. In addition to targeting pro-government forces­ in Syria, those insurgents have carried out attacks inside Lebanon.

“We have managed to hold out for this long,” said Abu Nidal, the nom de guerre of a fighter who helps run a field hospital in Zabadani.

But the conditions for rebels and the remaining civilians in the city are worsening, he said, speaking by telephone. “There’s no electricity, hardly any medical care and the food for most of us consists of crackers and bits of bread.”

Suzan Haidamous and Sam al-Refaie in Beirut contributed to this report.

Read more:

After setbacks, U.S. military looks for ways to recalibrate new Syrian force

In Syria, deadly road-rage incident tars President Assad’s family

Today's coverage from Post correspondents around the world