A senior Libyan military official says an Islamic State suicide bomber has rammed his car into a checkpoint in the country's west manned by a militia from the western city of Misrata, killing five militiamen.

The official told The Associated Press that the attack took place on Thursday near the town of Abu-Qrain, 80 kilometers (50 miles) from Misrata. He spoke on condition of anonymity because he is not authorized to speak to reporters.

Misrata is home to one of the strongest militias in Libya, which played a key role in toppling late dictator Moammar Gadhafi.

But an IS affiliate that emerged in Libya has used the turmoil gripping the country in recent years, seizing the central coastal city of Sirte last year and creating its own stronghold there.