Libyan pro-government forces have freed 13 foreigners held by Islamic State of Iraq and the Levant in its former coastal bastion of Sirte.

A government spokesman said on Saturday 11 Eritrean female captives, a Turk, and an Egyptian were released after a battle to recapture a part of the city held by ISIL.

Sirte fell to the armed group more than a year ago after its fighters took advantage of infighting that emerged among Libya's rival factions following the 2011 fall of Muammar Gaddafi.

Forces allied with Libya's UN-backed Government of National Unity began an offensive on May 12.

After a six-month campaign of street-by-street fighting backed by US air strikes, Libyan forces have taken back most of Sirte, where ISIL fighters are holding out with snipers, boobytraps and car bombs.

"The forces have completely recaptured the 600 block area in Sirte from gangs of Daesh [Arabic acronym for ISIL], and now the Ghiza Bahriya area is the last pocket of resistance," said Rida Issa, a spokesperson for the pro-government forces.

Libya forces make final push to clear ISIL from Sirte

Forces fighting ISIL in Sirte are mostly from nearby Misrata, whose brigades are among the most powerful in Libya. They are allied with the UN-backed unity government in Tripoli that is trying to unite competing factions.

Western nations back the unity government hoping it will bring stability and help counter ISIL, as well as refugee-and-migrant smugglers. But Tripoli leaders have struggled to extend their influence. 

UpFront: Crisis in Libya - Who's to blame?

Source: Agencies