FOR 165 Senegalese, the journey of a lifetime ended in a fluorescent-lit, green-carpeted barn at the edge of Dakar’s international airport. Dressed uniformly in new white sneakers and hoodies reading “RISING” in large letters, they perched on plastic chairs and ate their first meal back on home soil out of foil containers. They had just returned from Tripoli, in Libya, on a flight put on by the International Organisation for Migration, a UN body. Of the 165, all but one were men, and all were young. They had been trying to get onto boats bound for Europe. Instead they had spent months—over a year for some—living on starvation rations in Libyan prisons.

And yet by their accounts, these are the lucky ones. “Today, to be back here, it is as good as if I made it to Europe,” says Mohammed Sylla, a 30-year-old trader. “Why did I want to go to Italy anyway? I was stupid.” He headed for Libya after trying to get to Europe through Morocco, but the moment he crossed the border from Algeria, it became “a hell”. He describes being beaten up repeatedly by soldiers, and hiding in a forest for six days without food. Two other migrants he was with, from Guinea, were shot by militiamen in front of him. “I thought I would die for sure,” he says, his voice dipping to a whisper. Black people are imprisoned, he continues, and sold on for labour or ransom.

Centuries ago, Senegal, on the western edge of Africa, was a stopping point for European ships taking slaves to the new world. On Goree Island, off the coast of Dakar, tourists can gawp at buildings where human beings were once kept like cattle. Today, Senegalese go on grim journeys of their own volition, in hope of a better life. Of 37,000 arrivals to Italy in the first four months of this year, around 7% were from Senegal. In that time the number of migrants, mostly from the Middle East, crossing to Greece from Turkey dropped by over 90% compared with last year. By contrast, the number going to Italy increased—most of them from west Africa. In Senegal it is possible to get a hint of what leads people to risk the journey to Europe. Kayar, a fishing village about 60km (40 miles) outside Dakar, is a place from where people have been seeking a way north for decades. On the beach, hundreds of wooden pirogues painted in dazzling colours crowd the sand; the buzz of saws at makeshift workshops fills the air. But fishing provides work only for a few months of the year, leaving young men with little to do. Instead, they dream up schemes for travelling north. Ali Diong, a 35-year-old fisherman, often chats on WhatsApp with friends who have made it to Spain and Italy. “They can send money to their wives, they can pay for baptisms,” he says. “We who are still here depend entirely on our parents.” Every migrant’s plan is different, he says, but in order to pay for their journeys, people sell assets, such as their boats or motorcycles, or families chip in to raise the fare. It is risky, he admits. “But here there is nothing. You have to do something, and emigration is all you have.” Kayar also offers hints of how illegal migration can be curbed. A decade ago, the area was a transit point for people trying to travel 1,500km across the Atlantic to the Spanish Canary Islands. According to Aliou Ndoye, the town’s assistant mayor, at the peak of that migration, in 2006, some 973 men from Kayar—which has a population of just 27,000—tried to cross. Hundreds of people died; some pirogues full of bleached corpses washed up in the Caribbean. Today, that route is all but closed, thanks to a deal Spain struck with Senegal to return migrants and patrol the coast for boats. Those who want to try to get to Europe face an even tougher journey. And from Kayar, fewer are going. Mr Ndoye reckons the number who have left this year is under 100. Those who do so now mostly head to Morocco instead of Libya. That is Mr Diong’s plan: “The desert is very dangerous, but I know the sea,” he reasons.

The trouble for European countries, desperate to curb the flow of boats across the Mediterranean, is that the message hasn’t reached other parts of Senegal yet. Jo-Lind Roberts-Sene, the representative of the IOM in Dakar, says that closer to the capital people have become more wary. But in more remote parts of the country, the idea that Europe is El Dorado persists. The majority of migrants going to Europe via Libya these days are leaving from south-east Senegal, which is separated from the rest of the country by the Gambia, and is far poorer. Migrants from there are usually farmers, and do not have much formal schooling. “They think they are aware of the dangers,” says Ms Roberts-Sene; but those who come back tell shocking tales.

That is certainly true of Thierno Mendy, a 37-year-old from eastern Senegal. “If I knew the journey would be like it was, I would never have done it,” he says. But failure is shameful, and many migrants are desperate to believe they have a chance. Massyla Dieng, a 50-year-old in Kayar who lived in Italy for ten years, says he has given up trying to persuade young men not to go. “When I say it is tough, they treat me like an enemy. They think I want them to fail.” Unfortunately, whatever the dangers may be, as long as a few are making it to Europe, the dream will never fully die.