Cairo: Egypt has launched emergency flights to Tunisia to bring back home thousands of Egyptian expatriates fleeing the escalating violence in neighbouring Libya.

Nearly 1,000 Egyptians have been flown home from Tunisia in an airlift that the government said will continue until all Egyptians flocking to Tunisia from Libya are repatriated.

Egypt has a large community, mostly workers, in Libya, which has been hit by its worst strife since an armed uprising deposed the regime of Muammar Gaddafi in 2011.

Libya’s main airports in its capital Tripoli and the eastern flashpoint city of Benghazi have been closed due to fighting among rival militias. The unrest has prompted several countries to evacuate their nationals and shut down their embassies.

The Egyptian Foreign Ministry said on Saturday it had contacted Libyan tribes to provide “protection and care” for Egyptians stranded on the Libyan side of the border with Tunisia. At least two Egyptians were reportedly shot dead on Thursday by Libyan security forces as thousands of refugees attempted to cross into Tunisia. Egyptian authorities have repeatedly urged Egyptians not to travel to Libya and advised those already there to avoid hotspot areas.

“We were subjected to attacks from Libyan militiamen, who also seized our possessions,” said Khalid Salem, an Egyptian returnee from Libya via Tunisia.

He told a local TV station that he went along with relatives to work in Libya just three months.

“Because of the bad situation there, we were unable to work and make up for the money we had spent as travel costs.”

Other returnees said at least 10,000 Egyptians remain stranded along the Libyan border with Tunisia, a figure that could not be confirmed by Egyptian authorities.

“[Egyptian] Foreign Minister Sameh Shukri has held several contacts with his Tunisian counterpart as part of following up on the situation of Egyptians present on the Libyan-Tunisian border,” said a spokesman for the ministry.

Tunisia temporarily closed its border with Libya on Friday, citing the mayhem caused by an influx of refugees.