Men press anxious faces against the chicken-wire fence of Triq-al-Sikka migrant detention camp in downtown Tripoli as I enter. “Welcome to hell,” says a Moroccan man, without a smile.

Triq-al-Sikka is home to 300 men penned into nightmare conditions. Several who are sick lie motionless on dirty mattresses in the yard, left to die or recover in their own time. Three of the six toilets are blocked with sewage, and for many detainees, escape is out of the question as they have no shoes.

It wasn’t supposed to be this way. After reports of torture and abuse in detention centres, and wanting to stop the flow of people across the Mediterranean, the European Union has since 2016 poured more than £110m into improving conditions for migrants in Libya. But things are now worse than before.

Among the inmates is Mohammed, from Ghana. In July, he survived an air strike on another centre, in Tajoura on the capital’s south-western outskirts, that killed 53 of his fellow migrants. After surviving on the streets, last month he got a place on a rickety smuggler boat heading for Europe. But it was intercepted by the coastguard. Mohammed fell into the sea and was brought back to this camp. His blue jumper is still stained by sea salt. He is desperate to get word to his wife. “The last time we spoke was the night I tried to cross the sea,” he says. “The soldiers took my money and phone. My wife does not know where I am, whether I am alive or dead.”

Triq-al-Sikka’s conditions are harsh, but other centres are worse. Inmates tell of camps where militias storm in at night, dragging migrants away to be ransomed back to their families. Tens of thousands of migrants are spread across this city, many sleeping in the streets. Dozens bed down each night under the arches of the city centre’s freeway. Since April, in a sharp escalation of the civil war, eastern warlord Khalifa Haftar has been trying to batter his way into the city in fighting that has left more than 1,000 dead and left tens of thousands of citizens homeless.

Facebook Twitter Pinterest Migrants who fled a detention centre in coastal Libya outside a UN facility in Tripoli. Photograph: AP

Libya has known nothing but chaos since the 2011 revolution that overthrew Muammar Gaddafi. In 2014, a multi-sided civil war broke out. Taking advantage of this chaos, smugglers transformed Libya into a hub for migrants from three continents trying to reach Europe. But after more than half a million arrivals, European governments have tightened the rules.

This clampdown is obvious at the gates of a nondescript fenced compound holding white shipping containers in the city centre. It is the UN’s refugee Gathering and Departure Facility, nicknamed Hotel GDF by the migrants. From here, a select few who qualify for asylum get flights via Niger and Rwanda to Europe. But there are 45,000 registered migrants, and in the past year only 2,300 seats on flights for migrants – which have now stopped altogether, with Europe offering no more places. Yet dozens line up outside each day hoping for that magical plane ticket.

Among those clustered at the fence is Nafisa Saed Musa, 44, who has been a refugee for more than half her life: In 2003, her village in Sudan’s Darfur region was burned down. Her husband and two of her three sons were killed and she fled. After years spent in a series of African refugee camps with her son Abdullah, 27, she joined last year with 14 other Sudanese families, pooling their money, and headed for Libya.

In southern Libya, Abdullah was arrested by a militia who demanded 5,000 dinars (£2,700) to release him. It took two months to raise the cash, and Abdullah shows marks of torture inflicted on him, some with a branding iron, some with cigarettes. They all left a charity shelter after local residents complained about the presence of migrants, and now Nafisa and her son sleep on the street on dirty mattresses, scrounging cardboard to protect from the autumnal rains, across the street from Hotel GDF. “I have only one dream: a dignified life. I dream of Europe for my son.”

Nearby is Namia, from Sudan, cradling her six-month-old baby daughter, clad in a pink and white babygrow. Her husband was kidnapped by a militia in February and never seen again and she makes frequent trips here asking the UN to look for him. “I hope he is in a detention centre, I hope he is alive.”

Last week, 200 migrants, kicked out of a detention camp in the south of Tripoli, marched on Hotel GDF and forced their way inside, joining 800 already camped there, in a base designed to hold a maximum of 600.

Facebook Twitter Pinterest Rescued migrants next to a coastguard boat in Khoms, east of Tripoli, last month. Photograph: Hazem Ahmed/AP

The UN High Commissioner for Refugees, which administers the centre, says it has no more flights, unless outside states offer asylum places: “We cannot reinforce the asylum systems there because it is a country at war,” says UNHCR official Filippo Grandi.

Meanwhile, escape by sea is being closed off, thanks to a controversial deal Italy made with Libya two years ago, in which Rome has paid €90m to train the coastguard. The deal has drastically cut arrivals in Italy from 181,000 in 2016 to 9,300 so far this year, with the coastguard intercepting most smuggling craft and sending migrants on board to detention camps.

“We have collected testimonies of torture, rape and murder in detention camps,” says Oxfam’s Paolo Pezzati. “The agreement the Italian government signed with Libya in February 2017 has allowed these untold violations.”

Italy to renew anti-migration deal with Libya Read more

Rome has faced criticism because among the coastguard leaders whose units it funds is Abd al-Rahman Milad, despite his being accused by the UN of being involved in sinking migrant boats and collaborating with people-smugglers. Tripoli says it issued an arrest warrant against him in April, but this is news to Milad. Bearded, well-built and uniformed, he tells me he is back at work and is innocent: “I have nothing to do with trafficking, I am one of the best coastguards in Libya.”

For migrants and Libyans alike, the outside world’s attitude is a puzzle: it sends aid and scolds Libya for mistreatment, yet offers no way out for migrants. “You see [UN officials] on television, shouting that they no longer want to see people die at sea. I wonder what is the difference between seeing them dying in the sea and letting them die in the middle of a street?” says Libyan Red Crescent worker Assad al-Jafeer, who tours the streets offering aid to migrants. “The men risk being kidnapped and forced to fight by militias, the women risk being taken away and sexually abused.”

Female migrants, fearing rape, often sleep on the streets close to police stations, but this brings new danger

Recent weeks have seen nightly bombing in an air war waged with drones. Women, fearing rape, often sleep on the streets close to police stations for safety, but this brings new danger. “They think 50 metres from a police base is close enough to protect themselves,” says al-Jafeer. “But they are the first targets to be bombed.”

Interior ministry official Mabrouk Abdelahfid was appointed six months ago and tasked with closing or improving detention centres, but admits reform is slow. He says many camps are outside government control and that the UN has provided no alternative housing for migrants when camps close: “We have already closed three [detention] centres. We believe that in the nine centres under our formal control there are more or less 6,000 people.”

A common theme among migrants here is a crushing sense of being unwanted and of no value, seen even by aid agencies as an inconvenience. For now, migrants can only endure, with no end in sight for the war. Haftar and Tripoli’s defenders continue slugging it out along a front line snaking through the southern suburbs and few diplomats expect a breakthrough at peace talks being hosted in Berlin later this month.

Outside Hotel GDF, dusk signals the end of another day with no news of flights and the migrants trudge away to sleep on the streets. To the south, the flashes from the night’s bombardment light up the sky.