TRIPOLI, Lebanon — Car bombs exploded outside two Sunni mosques in this northern Lebanese city on Friday as many worshipers were just finishing prayers, killing dozens of people, wounding hundreds and sending new sectarian shudders through the country, already deeply unsettled by the conflict in neighboring Syria.

The double bombing was the first time that mosques were targets in what had been an escalating series of attacks in Lebanon in recent months. Coupled with the sectarian overtones of the Syrian war and renewed fighting in Iraq — where at least 36 people were reported killed Friday in sectarian attacks across the country — the bombings compounded fears that the Middle East could be plunging into unbridled Sunni-vs.-Shiite warfare.

President Michel Suleiman cut short a visit abroad to meet with security officials and exhorted them to “deploy their efforts to reveal the perpetrators and the instigators.” Lebanon’s prime minister-designate, Tammam Salam, said in a statement that “the Tripoli crime is an additional indicator that the situation in Lebanon has reached a very dangerous level.”

Witnesses and the Lebanese news media said the blasts hit the Taqwa and Al-Salam mosques, which are in different parts of the city, minutes apart just before 2 p.m. Tripoli’s mayor, Nader Ghazal, was quoted as saying at least 50 people were killed, while the Health Ministry put the death toll at 35. The Lebanese Red Cross said more than 500 were wounded.