Two Italians kidnapped last July in Libya were freed on Friday in a raid on Islamic State group hideouts in a city near the capital, officials in Libya and Rome said.

"Two Italian hostages were released... in Sabratha after an operation targeting several houses after information reached security forces that Daesh elements were there," the city's mayor Hussein al-Dawadi said, using an Arabic acronym for IS.

"They are now at a police station in Sabratha," 70 kilometres east of Tripoli, he added.

Gino Pollicardo, 55, and Filippo Calcagno, 65, said in a statement released by the Sabratha municipality: "We are free and are relatively well physically but are psychologically exhausted. We urgently need to return to Italy."

In a video posted on the municipality's Facebook page, the pair were seen wearing tracksuits, with long beards and dishevelled hair.

Pollicardo's tearful wife told Italian media: "It's over, I spoke to him on the phone."

The foreign ministry in Rome confirmed the releases, saying that the two "are no longer in the hands of their captors".

"They are now under the protection of the Sabratha military council and are in good health," a statement added.

Both were among four employees of Italian construction company Bonatti who were kidnapped in July 2015 in the Mellitah region west of Tripoli.

Italy's foreign ministry said on Thursday that the two others had probably been killed in clashes between IS fighters and local militiamen near Sabratha.

Rome's prosecution office, which is investigating the kidnappings, said Fausto Piano and Salvatore Failla had been separated from Pollicardo and Calcagno.

Italian media reports said the four had been in an IS convoy that was attacked by militiamen from Fajr Libya (Libya Dawn), the armed wing of the non-recognised government based in Tripoli.

Chaos has engulfed Libya since the 2011 Nato-backed ouster of dictator Muammar Gaddafi and rival administrations are being urged to sign up to a UN-brokered national unity government to help restore stability.

The internationally recognised government is based in the far east of the North African country.

IS and other extremist organisations have exploited the power vacuum, making gains along the oil-rich coastal regions and triggering concern among Western nations over jihadists controlling territory just 300 kilometres from Europe.

Sabratha in the west has been the scene of intense fighting between local militias and IS since a US attack last month on an IS training camp on the outskirts of the city killed 50 people.

IS subsequently seized the centre of the city, only to be pushed back to its outskirts last week.

On Wednesday, the UN said at least 28 civilians including five children have been killed in fighting across Libya so far this year.

Related Story