Three car bombs ripped through the eastern Libyan city of Qubbah on Friday, killing 40 people and wounding 70, security officials and medics said.
There was no immediate claim of responsibility, but parliamentary speaker Aguila Saleh said the bombs appeared to have been in retaliation for Egyptian air strikes on nearby Derna, an Islamist militant hotspot.
On Monday, Egypt launched air strikes on suspected Islamic State targets in Derna, a day after the group released a video showing the execution of Egyptian Coptic Christian workers.
Three bombs exploded on Friday at a petrol station, the local security headquarters and the town council headquarters in Qubbah, which is Saleh's hometown.
"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."
A security official said the car bombs were probably suicide attacks but no more details were immediately available.
Libya is in chaos, with two governments and parliaments vying for legitimacy and territory, four years after Muammar Gaddafi was toppled.
The internationally recognised prime minister, Abdullah al-Thinni, is based in Bayda, some 40 km from Qubbah. Saleh works out of Tobruk, another eastern town home to the House of Representatives, the elected parliament.
The capital Tripoli 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.