BENGHAZI/TRIPOLI (Reuters) - Nine soldiers were killed on Saturday in an attack claimed by Islamic State on a training camp belonging to the eastern Libyan forces of Khalifa Haftar, hospital authorities said.

The attack took place in the city of Sebha, located in part of the oil-producing south that is targeted by armed groups looking to exploit a security void.

Haftar has concentrated his forces in the northwest, where they have been embroiled for the past month in a battle for the capital Tripoli with fighters allied to the divided country’s internationally recognized government.

Clashes raged in Tripoli’s southern outskirts throughout the night with the rival forces firing at each other with artillery guns, residents said. No more details were immediately available.

Islamic State claimed the Sebha attack. Its fighters had killed or wounded 16 and freed inmates from a prison, the jihadist group said in a statement posted online.

A military source said a jail inside the attacked Jabril Baba camp had been stormed but gave no details. Sebha hospital put the number of dead at nine, a statement on its website said.

Hamed al-Khaiyali, head of the local municipality, earlier told Reuters one soldier had been beheaded and seven others “slaughtered” or shot. Pictures posted online showed bodies fully covered by blankets.

A source in Haftar’s Libyan National Army (LNA) blamed Islamic State and Chadian fighters for the attack, the latter a term used by the LNA for tribesmen opposing Haftar.

News-gathering in southern Libya is difficult due to the absence of an effective state authority in a region dominated by different armed groups and tribes.

The LNA, which is allied to a parallel government in the east, faced strong opposition from ethnic Tebus during a military campaign it ran in the south at the start of the year.

Sebha - like much of the south and its oilfields - is controlled by the LNA but the force has co-opted local armed groups and tribesmen to control territory.

Such alliances often shift in a country that has been in chaos since the overthrow of Muammar Gaddafi in 2011.

The LNA has moved troops from its southern campaign toward the Tripoli front, also moving in heavy guns in the past week. But it has been unable to breach defenses in the city’s southern suburbs.

Islamic State is active in the south to where it retreated after losing its stronghold in the central city of Sirte in December 2016.

There have been several attacks in southern Libya since the Tripoli offensive, among them an assault on the Tamanhint air base outside Sebha and clashes at the El Sharara oilfield, the country’s biggest.

As well as the humanitarian cost, the Libya conflict threatens to disrupt oil supplies, boost migration to Europe and has scuppered a U.N. peace plan to hold elections to produce a unified government and army.