Three car bombs ripped through the eastern Libyan city of Qubbah on Friday, killing 40 people and wounding 70 in what officials described as a revenge attack for Egyptian air strikes on Islamist militant targets.
There was no immediate claim of responsibility. But parliamentary speaker Aguila Saleh said the bombs appeared to have been in retaliation for Egyptian air raids on nearby Derna, an Islamist hotspot.
On Monday, Egyptian air force jets bombed suspected Islamic State targets in Derna in far eastern Libya, a day after the ultra-radical group released a video showing 21 captive Egyptian Coptic Christian workers being decapitated on a beach.
Four years after rebels overthrew Muammar Gaddafi, the oil-producing North African state is in chaos, with two governments and parliaments allied to armed factions fighting for control, while Islamist groups exploit a power vacuum.
Three bombs exploded shortly before Friday prayers at a petrol station, the local security headquarters and the town council in Qubbah, which is Saleh's hometown, security officials said. His house is close to the town council.
There have been suicide and car bomb attacks mainly in the east of Libya but the targets have tended to be police and army bases rather than civilians, with security officials blaming Islamist groups such as Ansar al-Sharia.
"We are announcing seven days of mourning for the victims of Qubbah," Saleh told Al Arabiya television. "I think this operation was revenge for what happened in Derna," he said without elaborating.
He said he was outside Derna at the time of the attacks.
A security official said the car bombs were probably suicide attacks but no more details were immediately available.
The internationally recognized prime minister, Abdullah al-Thinni, is based in Bayda, some 40 km from Qubbah. Saleh works out of Tobruk, another eastern town now home to the House of Representatives, the elected parliament.
The capital Tripoli in the far west is under the control of a rival government and parliament, set up after a faction called Libya Dawn seized the city in summer, forcing Thinni to flee to the east.
Libya's neighbors and Western powers are alarmed by a spread of militant Islamists in the country. Last month, militants claiming loyalty to Islamic State stormed the Corinthia luxury hotel in Tripoli, killing five foreigners and at least four Libyans.
Supporters of the group, which has seized large areas of Iraq and Syria, have also taken over government and university buildings in Sirte, a central city, according to residents.