Foreign ministers from Algeria, Egypt and Italy called for a peaceful political solution in Libya on Sunday, saying that stability in the war-torn country would lead to reduced illegal migration to Europe.

Egypt and Algeria both have long, porous borders with Libya. Thousands of migrants seeking a better life in Europe cast off from Libya on rickety boats, hoping to reach Italy. Hundreds have died on the route this year alone.

Egyptian Foreign Minister Sameh Shoukry stressed at a joint news conference that Libya must form a unity government. He said Egypt supports Libya's internationally recognized government and army in "fighting terrorism."

Libya is divided between rival governments and militias, while militants allied to the Islamic State group grow in power.

Meanwhile Sunday, violence raged inside Libya. An official with the Islamist-allied Misrata militia said forces loyal to the Islamic State group attacked a militia checkpoint near the city of Abugrain, capturing and later killing three fighters. The official spoke on condition of anonymity because he wasn't authorized to brief journalists.