Sixty Egyptians detained in Libya over suspected visa violations have been released, a Libyan interior ministry spokesperson announced.
Thirty-nine of the 60 Egyptians did not have the required legal documents, Rami Kaal told Egyptian state news agency MENA on Saturday.
Egypt's ambassador in Libya, Mohamed Abou-Bakr, confirmed the 60 had been released after being held in custody since last week while their documents were checked.
A special committee was formed to investigate the matter, Kaal said.
The committee included representatives from the Libyan foreign and interior ministries and representatives from the Egyptian embassy.
Libya's envoy in Cairo said on Friday that some of the detained Egyptians would be deported because they did not have the correct papers.
On Saturday, the Egyptian foreign ministry said Libya had released 21 detained Egyptians and agreed to release an additional 36, allowing them time to get their documents in order.
Seventy Egyptians were reportedly detained in the Ain Zara, Salahaldin, and Souk Al-Gomaa areas of the Libyan capital Tripoli and transferred to a "crime prevention centre."
Libya is a major destination for Egyptians seeking work abroad. According to a 2010 report by the International Organisation for Migration, some 1.5 million Egyptians were working in Libya at the time.
However, the number of Egyptian expats in the country fell sharply after the NATO-backed Libyan uprising in 2011/12, which saw the ouster and death of long-time Libyan leader Muammar Gaddafi.
Last month, seven Egyptian Coptic Christians were found shot dead on a beach outside Benghazi after they were abducted from their apartments the previous day.
In January, Libyan militants took seven Egyptian diplomats hostage in Tripoli in response to the arrest of a Libyan militia figure by the Egyptian authorities. The diplomatic staff was released several days later.