Militants claiming loyalty to Islamic State said they were behind Sunday's twin bomb attacks on the residence of the Iranian ambassador in the Libyan capital and a rocket strike on the eastern Labraq airport, a group statement.

The attack on the ambassador's residence came two days after the group claimed responsibility for a double suicide bombing that killed more than 40 people in the eastern town of Qubbah, one of the worst attacks on civilians since a 2011 uprising toppled Moammar Gadhafi.

Western powers are concerned that Libya is emerging as a thriving battleground for militants loyal to Islamic State, which controls large areas of Iraq and Syria. Islamist fighters have exploited instability as two rival governments fight for control of territory.