Following recent mass arrests in Libya, six migrants were shot dead after guards opened fire at an overcrowded detention centre.

Guards at a detention facility in Tripoli, Libya, had killed at least six migrants, the International Organization for Migration (IOM) said Friday.

According to the IOM, in the last few days, thousands of migrants have been sent to detention centres despite having legal documents to live in Libya. As per DW, Federico Soda, head of the Libyan mission of the IOM, said that he couldn't exactly say what was the reason behind the shooting, but it was "related to overcrowding and the terrible, very tense situation" at the centre.

While six died, many other migrants got injured and lots more fled the facility. Guards had fired into the air to control earlier incidents of chaos at the detention facility, said Soda.

This comes days after after Libyan security forces carried out raids on temporary shelters and houses in Gargaresh, a suburb of Tripoli, where many migrants and asylum-seekers stay. Those raids had left at least one person dead and many others injured, said the UN Support Mission in Libya (UNSMIL).

Libyan officials have denied using excessive force, and said that the detentions were part of anti-drug raids on makeshift shelters and houses in Gargaresh.

UNSMIL was "extremely concerned" about reports of "excessive use of force against migrants" and killings in the area.

At least 5,000 migrants had been "detained during violent mass arrests across the city since Oct. 1," said Doctors without Borders or Médecins Sans Frontières (MSF). Ellen van der Velden, MSF’s operations manager for Libya, said in a statement, “We are seeing security forces take extreme measures to arbitrarily detain more vulnerable people in inhumane conditions in severely overcrowded facilities." She added that several families had been taken to various detention facilities, and the process had hurt many family members and split them apart.

Many of those who were arrested have registered with the UN refugee agency, which means they have been recognized as asylum seekers or refugees. Hussein Baoumi, Libya and Egypt campaigner at Amnesty International, told Al Jazeera, “These people are escaping persecution from their countries of origin and should be protected, not imprisoned."

In Libya, there are hundreds of thousands of migrants who are looking for work in the major oil-producing country or want to travel onwards to Europe.

African migrants gather at a makeshift shelter in the capital Tripoli's suburb of Ain Zara African migrants gather at a makeshift shelter in the capital Tripoli's suburb of Ain Zara, on October 9, 2021. - Late last week, Libyan authorities raided multiple houses and makeshift shelters in a poor suburb of Tripoli, in what it said was an anti-drug operation. The UN said the raids, mostly targeting irregular migrants, left at least one person dead, 15 wounded and saw more than 5,000 detained. Photo by Mahmud Turkia/AFP via Getty Images