Libyan protesters burn an American flag in the eastern city of Benghazi on Feb. 20 while calling on the international community to lift the ban on arming the Libyan army. (Abdallah Doma/AFP/Getty Images)

Militants loyal to the Islamic State said three suicide car bombers staged attacks in eastern Libya on Friday, killing at least 35 people in apparent retaliation for Egyptian airstrikes following the mass beheadings of Christian migrant workers.

The bloodshed in Qubba — near the Islamic State stronghold of Derna on the Mediterranean coast — was among the deadliest attacks by the militants against civilians in Libya as they seek to expand amid the country’s internal chaos.

It also comes less than a week after Egyptian warplanes targeted Islamic State sites in Derna in response to the beheading of 21 Christians, all but one from Egypt. Later Friday, the spokesman for the Libyan National Army said Libyan warplanes had carried out strikes against the Islamic State in Sirte. The militants posted a statement online claiming that the strikes caused no damage.

A statement posted to an online militant forum claimed responsibility for the attacks in Qubba as “revenge” for those killed in Derna — an apparent reference to the airstrikes. The statement also cited Libya’s internationally recognized government for “conspiring” in the air attacks and other crackdowns.

Qubba, about 25 miles west of Derna, is controlled by the government recognized by the international community as Libya’s leadership. A separate, rival administration holds the capital, Tripoli.

The three blasts targeted a busy gas station, a security building and the home of the speaker of the country’s internationally recognized parliament, local media and Libya’s health minister said.

[Why the Islamic State has its eyes on Libya]

Libyan Health Minister Reda al-Menshawi said 35 people were killed. But that figure could rise because many others were reported wounded.

The Associated Press cited security officials as raising the death toll to at least 45. The Reuters news agency quoted security officials setting the number at about 40.

Just hours after the attack, parliament speaker Aguila Saleh, whose house was targeted, told the Saudi-owned al-Arabiya television network that he believed the attacks were in retaliation for the airstrikes.

The United Nations Support Mission in Libya said it “strongly deplores” the attacks, calling them “cowardly acts.” But it also urged Libya’s feuding political factions to unite as the “best response to counterterrorism and violence.”

The airstrikes Monday came after the mass beheadings of the Christians, all but one of them Egyptian Copts, by Islamic State militants in the Libyan city of Sirte. The other victim was identified as a Ghanaian Christian who had been working in Libya.

The extremist group — which holds wide swaths of territory in Iraq and Syria — has recently made inroads in eastern Libya, which has been wracked by internal unrest since the uprising that toppled Moammar Gaddafi four years ago.

Egypt has called for stronger international intervention in Libya to halt the march of militants. Egypt’s government has backed the forces of former Libyan general Khalifa Hifter, who claims he is fighting militant groups in Libya but has also taken on the country’s Islamist politicians.

The United States supports U.N.-sponsored peace talks between the two sides and has backed away from calling for military intervention.

Libya now has two rival governments, including a pro-Hifter parliament in the eastern city of Tobruk and another aligned with the Islamists in the capital, Tripoli.

Murphy reported from Washington. Heba Habib in Cairo contributed to this report.