BENGHAZI, Libya — At least 46 people have been killed in clashes between Daesh (so-called IS), a rival Islamist group and forces loyal to the official government in two Libyan cities, residents and medics said on Friday. The fighting typifies the chaos in the oil-producing country, where two governments, former rebels and militant groups are battling for control, four years after the ousting of veteran ruler Muammar Gaddafi. In the main eastern city, Benghazi, Daesh attacked forces loyal to the official government. They killed nine soldiers and destroyed a tank and three military vehicles, residents and medics said. Seven soldiers were also wounded in the attack in the central area near the commercial port, closed for more than a year because of the fighting. A warplane could be heard later, as government forces brought in reinforcements. In Sirte, a central city about 500 km (300 miles) east of the capital Tripoli, Daesh fought with a rival Salafist Muslim group and armed residents who have been trying to expel it. Daesh fighters took over the city in February, expanding their presence in the North African country by exploiting a security vacuum, as they did in Iraq and Syria. Fighting raged until early on Friday before dying down when Daesh took back a district which the Salafists and armed residents had tried to seize, residents said. Through the day the city was quiet, giving residents the chance to remove bodies strewn in the streets, among them women and children. Around 37 people have been killed in the past two days, residents said. "Families are leaving Sirte," said a resident, asking, like others, not to be named. He said Daesh fighters were searching for people with weapons. A similar battle occurred in the eastern city of Derna in June when Daesh was expelled by rival fighters who teamed up with locals angered by the arrival of foreign militants and clerics. Daesh launched an offensive to retake Derna this week. Libya has two governments fighting each other for power, while Daesh and other armed groups carve out their own fiefdoms. The United Nations brought the main warring factions together in Geneva this week but the diplomacy has been overtaken by fighting between groups not present at the negotiating table. — Reuters