BEIRUT — A pair of suicide bombings at Iran's embassy that killed an Iranian diplomat and at least 24 other people underscored how the violence in Syria has traversed borders and fanned sectarian tensions across the Middle East.

Lebanon has long been a secondary theater of the Syrian conflict, but Tuesday's twin blasts in Beirut were a blow aimed directly at Iran, one of the major foreign backers of the embattled government of Syrian President Bashar Assad.

Beginning with peaceful protests during the "Arab Spring" that challenged Assad's autocratic rule, Syria's strife has devolved over the last 32 months into a regional proxy war stoked by sectarian malice. It has cost tens of thousands of lives, forced millions from their homes and left broad swaths of Syria in ruins, while exporting instability to neighboring nations.

Tuesday's attack was the latest sign that the war raging in Syria cannot be contained within its borders.

"Once we see a flare-up of the tension that is boiling in Syria, there will be hardly a possibility of stopping it at the Syrian border [or] even within the Middle East," Iranian Foreign Minister Mohammad Javad Zarif told reporters Tuesday in Rome.

The attack was Lebanon's fourth Syria-linked bombing since July. Violence tied to the conflict also has erupted in neighboring Turkey and Iraq, while multitudes of Syrian refugees have taxed resources and elevated social unrest in surrounding countries.

Tension between Islam's two major branches, Shiite and Sunni, have come to a head in Syria, with Shiite Iran supporting the government of Assad, a member of the Alawite sect, which is a Shiite offshoot. On the other side, Turkey, along with Saudi Arabia and other Sunni nations, back the mostly Sunni rebels, whose ranks include ascendant Al Qaeda-linked groups and thousands of foreign militants. Their sectarian hostilities have also jumped borders.

Iranian officials vowed that the bombing attack would not diminish their backing for Assad or for Tehran's Lebanese ally, Hezbollah, which has dispatched militiamen to Syria to fight alongside Assad's forces.

"Such actions will have no impact on Iran's continued support for the Islamic resistance current," Ali Shamkhani, who heads Iran's Supreme National Security Council, told state media.

Syrian Information Minister Omran Zoubi said in a statement that the bombings "smell of petrodollars," directing the blame at Saudi Arabia and other Persian Gulf states.

An Al Qaeda-linked group, the Abdullah Azzam Brigades, took responsibility for the attack and vowed more if Hezbollah did not withdraw its forces from Syria. Some elements of the Syrian armed opposition have repeatedly promised to bring the fight to Hezbollah's home turf, and Tuesday's attack pointed up that resolve.

Some pro-rebel social media forums lauded the strike against Iran, which the opposition has accused of propping up Assad's government and providing Damascus with arms, cash, military training and fighters.

"We have come to you in your homes," Al Nusra Front, a Syrian rebel group linked to Al Qaeda, said in a Twitter post addressed to Hassan Nasrallah, the leader of Hezbollah. "And what is coming is worse.... We have come to you with slaughter and car bombs."

Just last week, Nasrallah declared that Hezbollah would continue to send its militiamen to Syria, drawing condemnation from anti-Assad groups there and in Lebanon.

In Syria, anti-Assad rebels face a quickly deteriorating battlefield tableau. Bolstered by Hezbollah, Syrian forces in recent months have been methodically winning back territory, from Aleppo province in the north to central Homs to the suburbs of Damascus, the capital.

Hezbollah has portrayed itself as a bulwark against Al Qaeda terrorists intolerant of anyone not espousing their militant views. But Hezbollah's involvement in Syria has spurred deep resentment among its many opponents here and elsewhere. Syrian opposition leaders disturbed by the presence of Al Qaeda forces in the rebel ranks also have called for Hezbollah to leave Syria. But the Lebanese group says it is undeterred in its determination to assist the Syrian government.

"The people who are losing on the ground in Syria, the people [who] don't want a political solution in Syria, are behind this terrorist" act, Nawar Sahili, a Hezbollah member of Lebanon's parliament, told reporters at the blast site.

In Lebanon, which has strong historic and cultural ties to Syria, the conflict next door has caused concern about the future of Beirut's fragile pluralistic democracy, forged after a civil war that ended in 1990.

After Tuesday's bombings, Lebanese authorities denounced attempts to tear their nation apart, declarations that have become standard fare after periodic bombings and attacks linked to Syria. They also expressed condolences to Iran.

"The hand of terror will not be able to turn back the clock and reopen a black page in Lebanon's history," Lebanese President Michel Suleiman said in a statement.

The Lebanese population is roughly split along sectarian lines on the war in Syria, with Shiites generally supportive of the Syrian government and Sunnis backing the opposition. Given such divisions, Lebanese officials have declared an official policy of neutrality in the conflict.

Even Sunni politicians who support the Syrian opposition, such as former Prime Minister Saad Hariri, leader of a rival political bloc to Hezbollah, denounced Tuesday's attack.

The area near the Iranian Embassy is heavily guarded, and the explosions appear to indicate a major security breach.

Authorities said the attack, which injured more than 150 people, involved a pair of suicide attackers, one on a motorcycle and the other in a bomb-rigged sport utility vehicle. According to various accounts, the first bomber, reportedly wearing an explosives-packed belt, detonated his 10-pound payload near the embassy gate, though it was unclear whether he was on foot or still on the motorcycle at the time.

Some theorized that the first bomber was meant to open the way for the bomb-laden vehicle to drive into the embassy compound, which is mostly set off from the street. But the car bomb, which Lebanese authorities said contained about 100 pounds of explosives, detonated outside the compound, heavily damaging the residential neighborhood of Bir Hassan, a predominantly Shiite district of south Beirut.

Images from the scene showed cars ablaze and blasted into pieces, charred bodies on the ground and nearby buildings with extensive damage to their facades. As thick black smoke poured from the site, firefighters struggled to douse the flames, and rescue workers pulled bodies and the wounded from the debris.

Later, Iran confirmed the death of the embassy's cultural attache, Ebrahim Ansari, described as a cleric who had arrived at the post a month ago. Four embassy guards also were killed, Iranian officials said. But most of the casualties appeared to have been Lebanese passersby and motorists.

patrick.mcdonnell@latimes.com

Special correspondents Lava Selo in Beirut, Ramin Mostaghim in Tehran and Nabih Bulos in Philadelphia contributed to this report.