BEIRUT (AP) — Lebanese authorities charged five men Friday in connection with the deadly bombings last week in the northern city of Tripoli that have raised sectarian tensions to dangerous levels in the country, a security official said.

The blasts, which targeted two Sunni Muslim mosques and killed 47 people, came less than two weeks after a deadly explosion in a Shiite neighborhood south of Beirut. The attacks have heightened fears that Lebanon could be slipping into a cycle of retaliatory violence fueled in part by the increasingly sectarian conflict in neighboring Syria.

The official said three of the defendants, identified as Hashem Menkara, Ahmad al-Ghareeb and Mustafa Houri, face charges of orchestrating the Aug. 23 bombings in Tripoli. The official spoke on condition of anonymity because of regulations preventing him from being named.

The three Lebanese have ties to the Islamic Unification Movement, a Sunni organization that enjoys good relations with Lebanon’s powerful Shiite militant Hezbollah group as well as the Syrian government.

The official identified the other defendants as Mohammed Ali, a Syrian officer, and Khodr al-Aryan, a Syrian civilian. The two have been charged with preparing the explosives for the attack, the official said. He did not specify whether the officer was with Syria’s military, intelligence or security forces.

Lebanon has been deeply divided by the civil war in Syria, where a Sunni-led insurgency is trying to oust a regime dominated by President Bashar Assad’s Alawite sect, an offshoot of Shiite Islam.

The Syrian rebels enjoy the backing of many Lebanese Sunnis, while the Syrian government has the support of Lebanon’s Shiite community, including Hezbollah.

Hezbollah has openly declared that it is fighting alongside Assad’s forces in Syria. Its overt role has sent sectarian tensions soaring in Lebanon, where street clashes have erupted on numerous occasions in recent months.