Six Egyptians, including two diplomats, are freed after being abducted from their homes in Tripoli on Friday and Saturday

This article is more than 6 years old

This article is more than 6 years old

In a co-ordinated swap, Egypt has released a Libyan militia commander detained over suspected links to the Muslim Brotherhood while six abducted Egyptians, including two diplomats, have been released in Libya.

The six Egyptians – two diplomats, three embassy staffers and one Egyptian resident of Libya – were seized from their homes in a wave of attacks late on Friday and early on Saturday in the Libyan capital, Tripoli.

Subsequently, one of the purported kidnappers – who only identified himself as a "revolutionary" – said in a telephone call to the al-Arabiya TV network that the Egyptians would not be freed until the Islamic militia commander, Shaaban Hadiya, was released by Egypt.

Hadiya is the head of the militia known as Revolutionaries Operation Room, which claims to answer to the Libyan army but is widely seen as operating independently. Last year the Libyan government blamed the group for the abduction of the prime minister, Ali Zidan, who was briefly kidnapped by gunmen in Tripoli.

On Saturday the militia's spokesman, Adel al-Ghiryani, said that Hadiya, also known as Abu Ubeida al-Libi, had travelled to Egypt for medical reasons but was detained there.

Ghiryani also denied his group was involved in the kidnapping of the Egyptians.

An Egyptian security official said authorities had detained Hadiya because he was the guest of the country's Muslim Brotherhood group, which has been declared a terrorist organisation in the wake of the military coup that removed Mohammed Morsi, who hails from the Brotherhood, from power last July. The official did not elaborate and spoke on condition of anonymity because he was not authorised to speak to the media.

Egypt's interior ministry only said that Hadiya was being held because his residency permit had expired.

Egyptian foreign ministry spokesman Badr Abdelattie attributed the release of the Egyptians to official and "unofficial" mediation. He did not elaborate.

Kidnappings are rife in Libya, where the 2011 overthrow of the dictator Muammar Gaddafi left a security vacuum that has since been filled by rebels-turned-militiamen in the absence of a unified military and central police force.