Eighteen foreign fishermen who were held in war-torn Libya for more than three months have been released after a visit by Italy’s Prime Minister Giuseppe Conte.

Libyan patrol boats loyal to Gen Khalifa Haftar arrested the men, who are based in Sicily, on 1 September. The group were accused of trespassing in Libyan waters.

Italy disputed that claim.

The detention of the men was embarrassing for Mr Conte, accused by some of being too soft on the general.

Of the 18, eight are Italian nationals. Six are from Tunisia, two are Indonesians and two are Senegalese.

They operated from the Sicilian village of Mazara del Vallo and fished off the Libyan coast in waters that have long been rich in highly-prized red prawn.

Libya has been torn by violence since long-time ruler Col Muammar Gaddafi was deposed and killed in 2011 by Nato-backed forces.

Foreign minister Di Maio posted this photo on Facebook

Gen Haftar’s forces, which control the eastern Libyan city of Benghazi and a large swathe of the country, are battling the UN-recognised government based in the capital Tripoli.

It is not clear what, if anything, Gen Haftar may have received in return for the sailors’ release.

The men’s families had been campaigning in the Italian capital Rome to try and secure their freedom. On Thursday Cristina, the wife of one of them, said: “I can’t wait to see them coming back home, and enjoy my moment, putting politics aside… It’s already Christmas for us.”

Italy has made several attempts to broker peace between Gen Haftar and the Tripoli government.

The conflict has put pressure on Italy especially because of people-trafficking from Libya across the Mediterranean. Migrants desperate to leave risk their lives trying to reach Italy on crowded, unseaworthy boats.

Italy’s Foreign Minister Luigi Di Maio accompanied Mr Conte on the brief visit to Benghazi and celebrated the release in a Facebook post.

“Thanks to Aise (our foreign intelligence service) and the whole diplomatic corps, who worked to get them home,” he wrote. “A hug for the whole Mazara del Vallo community.”

He added that he and Mr Conte had told Gen Haftar that Italy was continuing to back stabilisation efforts in Libya.