Ten fighters loyal to the self-proclaimed government that controls Tripoli were killed Wednesday by Islamic State militants in central Libya, as the Islamists spread their reach in the divided country.

Islamist militants in Libya who have allied themselves to the Islamic State group that controls parts of Iraq and Syria had until recently been mostly active in the east, where the internationally recognized government is now based.

But in recent weeks they have expanded westward to the city of Sirte, taking government buildings, a hospital and the university, posing a challenge to the Tripoli-based government and its allied factions which have engaged them in battle.

“A number of our hero army members were assassinated this morning by the Islamic State in the Nawfaliyah area,” said Osama Abu Naji, a senior official in the Tripoli-based government, referring to a town southeast of Sirte.

“The victims were assassinated, it was not confrontation,” he told reporters, without elaborating.

Anticipating more clashes, Sirte residents were seen leaving in a column of cars on the main highway to Misrata, a Reuters reporter said.

In the evening, more than 1,000 people, some weeping, gathered in the center of Misrata, some 200 km [120 miles] west of Sirte, for the dead fighters' funeral.

Forces from Misrata loyal to Tripoli initially deployed in December east of Sirte to try seize Libya's biggest oil ports, Es Sider and Ras Lanuf, from troops loyal to the internationally recognized government.

But they have been dragged into fighting the Islamists who are exploiting the chaos created by the existence of two rival governments.

Four years after the ousting of Moammar Gadhafi, Libya is divided, with the official premier Abdullah al-Thinni working from the east since a rival faction seized Tripoli in August, reinstating a previous parliament and setting up a rival administration.

There were also heavy clashes between Islamist fighters and forces allied to the recognized government in the eastern city of Benghazi on Wednesday, residents said. That fighting has been ongoing for almost a year.

Militants loyal to Islamic State have claimed several high-profile attacks in the past two months including the storming of Tripoli's luxury Corinthia hotel and the beheading of 21 Egyptian Copts from Sirte.