TEHRAN — Gone is the talk here that last year’s Arab Spring was a gift from God.

Now some in Iran are even starting to worry about how much might be at stake if President Bashar al-Assad’s government in Syria, long a client state of Iran’s, collapses — which after a fifth day on Thursday of heavy street fighting in Damascus no longer sounds inconceivable.

The fall of the Assad government would remove Shiite Iran’s last and most valued foothold in the Arab world, and its opening to the Mediterranean. It would give Saudi Arabia and other Sunni Arab states their long-sought goal of countering Iranian influence in the region, finally splitting the alliance between Tehran and Damascus that has lasted for decades. And it would further erode Iran’s role as a patron of the Middle East’s revolutionaries, a goal that moderate Arabs and the United States have long sought.

Already the militant Palestinian group Hamas, long dependent on Syria and Iran, has thrown its support behind the Syrians in the streets seeking Mr. Assad’s overthrow.

Worse might follow, from Tehran’s point of view. Iran and Syria’s last revolutionary ally, the Hezbollah party that dominates Lebanon, would lose one of its main sources of weapons and financial support. And Lebanon’s fragile sectarian balance might be torn apart, raising the threat of another civil war there.