A military strike that killed dozens of people at a detention centre in Libya has focused attention on the treatment of refugees and migrants in the turbulent country, and amplified calls to shutter the lockups they are housed in once and for all.

Human rights groups and analysts told InsideOver that the deaths of at least 53 mostly African migrants, and injuries to 130 others in the facility in Tajoura, an eastern suburb of the capital, Tripoli, should galvanise efforts to stop any similar tragedy happening again in the future. Anger was focused on the detention centre’s guards, who shot at detainees as they fled the aerial bombardment. Others blamed the Libya’s UN-backed government for needlessly detaining migrants, and at the European Union (EU) for closing down their transit routes across the Mediterranean Sea.

The United Nations led a chorus of calls for a war crimes investigation into the attack, which occurred at a military site during a conflict. Elinor Raikes, the director for Europe and North Africa at the International Rescue Committee, an aid group, called for a quick rethink on detaining migrants. “The attack has so far claimed the lives of at least 53 people, all of whom found themselves detained in the middle of a war zone,” Raikes told InsideOver in a statement. “For the 400 others who escaped harm, there is no safe place to find refuge. The conflict surrounding them and the atrocity that has taken place points to one thing: vulnerable people, particularly those who are fleeing conflict and crisis, should not be detained.”

Some 6,000 migrants and refugees are held in lockups across Libya, according to Libyan migration officials, including at least 3,000 in or near the capital, Tripoli, which has been the scene of intense fighting in recent weeks. Worse still, thousands of them are detained in facilities close to conflict zones or military bases, like the hangar in Tajoura. In itself, this can constitute a war crime, as it exposes detainees to a military strike hitting the wrong target.

Libya’s internationally recognised Government of National Accord (GNA), based in Tripoli, has been under siege by renegade military commander Khalifa Haftar’s self-styled Libyan National Army (LNA) since April. The UN’s refugee agency, UNHCR, had called in May for the Tajoura hub to be closed after a projectile landed some 100 meters away, injuring two migrants. Shrapnel from that blast tore through the hangar’s roof and almost hit a child.

Migrants transiting Libya have faced arrest and detention for decades, but the NATO-backed overthrow of Muammar Gaddafi in 2011 and the country’s collapse into inter-militia violence increased the risks they faced there. Libya’s mission to the UN did not respond to InsideOver’s request for comment.

Libya is one of the main departure points for African migrants, fleeing poverty and war, to try to reach Italy by boat, but many are picked up and brought back by the Libyan coastguard, in a scheme backed by the EU. An EU spokesperson told InsideOver that the bloc wants to stop migrants and refugees from drowning at sea and supports the Libyan coastguard’s efforts to intercept boats and end the “cruel and inhumane” business of people-smugglers. Under a program with the African Union and the UN, some 40,000 migrants and refugees have been resettled back in their home countries, while 4,000 others have been granted protection and resettled in another country, the EU spokesperson said.

“There is no easy solution to the current situation and this will require political courage at EU level,” Camille Le Coz, a policy analyst at the Migration Policy Institute Europe, a think tank, told InsideOver in a statement.

“Niger may be willing to accept evacuations of migrants stranded in Libya in the short term, but the government will demand guarantees that these migrants will not remain stranded in the country. In other words, that the UN’s migration office will provide them assistance to voluntarily return to their home country or those countries in Europe or elsewhere will resettle the refugees.”