The Islamic State group's affiliate in Libya has claimed responsibility for an explosion at a police station in the country's capital, Tripoli.

The blast early on Thursday caused panic among residents but no one was hurt.

Police say the explosion was set off by militants who had placed explosives under police vehicles in the central neighborhood of Zawyat al-Dahmani. The front of the police station and some nearby buildings were damaged.

It was the first attack on a Tripoli police station claimed by IS. The group has targeted embassies and hotels.

Libya turmoil has provided fertile ground for IS-allied militants, who control the eastern city of Darna and also Sirte.