The official told The Associated Press that the attack took place near the town of Abu-Qrain, 80 kilometres 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 Muammar Gaddafi.
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.