More than 500 sub-Saharan migrants from different nationalities and backgrounds quietly left their hideouts in the woods near the Spanish enclave of Ceuta in northern Morocco on 29 September 2005. Some had lived in the woods for more than two years. They confronted the armed guards and barbed wire surrounding the enclave, and stood in the dark holding ladders made of rags, an army of hungry migrants dreaming of the world beyond the tall fences. Like medieval warriors waiting outside a besieged fort, they evaluated their chances and began their attack. It was the migrants’ first mass action. No one anticipated violence.

The Moroccan security forces called for reinforcements. Large lamps lit the area, soldiers arrived, guns were fired. Five migrants were killed and 100 injured.

On 6 October hundreds of other sub-Saharan migrants, with no coordination between the groups, attacked the fences along the border with another Spanish enclave, Melilla, a Mediterranean port near the northern frontier with Algeria. Six died and 30 were injured. The Spanish authorities denied using force in both cases and the Moroccans accepted no responsibility.

After the shootings, Moroccan soldiers flushed out migrants still hiding in the woods outside the enclaves. Men and women were rounded up, loaded on to chartered planes and deported to Mali, Senegal, Nigeria or other presumed countries of origin. Others were taken in buses to the Sahara in the south of Morocco and dropped there in the middle of the night. Some died.

Spain increased pressure on Morocco to halt migration through its borders. Security around the enclaves increased and crossing into them became nearly impossible. The migrants fled to Oujda, Nador, Rabat and Casablanca, and lived in makeshift camps, woods and other hideouts, or in poor neighbourhoods.

Search for survivors

In summer 2006 I travelled to Tangiers, a city of more than half a million in northern Morocco, searching for survivors of the two attacks. I know that thousands of sub-Saharans have left their birthplaces to flee poverty and political violence and find a new and secure home in the West. As legal migration has grown harder and borders have been sealed shut, they travel clandestinely, ready to do deals with human smugglers who promise to bring them closer to their goal.

Because it is so near Europe, Morocco is a leading transit country, the last stop on the long journey. Many migrants came to Tangiers before the events of autumn 2005, to risk their lives and brave the tidal currents of the Atlantic and Mediterranean as they voyaged in small, overcrowded fishing boats, intending to land in Spain. Every year hundreds died ­ and still die ­ on this voyage. Those unwilling to take the maritime risk, or unable to pay the human smugglers to arrange their journey across the sea, opt for a less dangerous journey. They try to enter Ceuta, only a short drive from Tangiers. Before October 2005 perhaps a thousand African migrants lived in the woods near Ceuta, some for a few months, others for more than two years. They built camps and homes made of plastic and other scavenged materials. They were divided by nationality, customs and language (that of their former colonial powers); French-speakers lived on one side of a camp, English on the other.

There were occasional tensions but mostly they lived in peace, bound by a common dream of entering the enclave. One group was in charge of travelling to a nearby town to beg for food and money. Some fetched water in plastic containers. Others were responsible for doing laundry. Nathalie Darries of Medecins Sans Frontières (MSF) says they were very organised: MSF provided basic health care, for the winters were cold and long, and the migrants’ needs were many, beyond the meagre resources provided by NGOs. “Gaining their trust was difficult in the beginning,” Said Bouamama, a young Moroccan activist and founder of a local NGO, told me. He took food and blankets to the people hiding in the woods. He also organised a football tournament, an African Cup. “We gave them uniforms, a football, and a cup for the winner.” They formed disciplined teams, cleared an area in the woods, practised and played like professionals. “Football gave them a sense of normality.”

Then came the 29 September assault. The football ended and police began to watch the woods closely, all movements in and out. Many were arrested. Some escaped. Those still in the woods lived in constant fear and did not trust visitors. Bouamama and other aid workers had difficulties visiting them.

A young survivor I met outside the offices of the United Nations High Commissioner for Refugees (UNHCR) in Rabat, Morocco’s capital city, recalled the night of the attack: “I was there that day. I saw men die.” He is in his early 20s, from a poor family in the Ivory Coast, and had lived in the woods outside Ceuta for more than two years before the attack. As he was stranded in Rabat, he had come to the UNHCR for help, hoping for refugee status. His chances were nil: he had left home to escape poverty and now he was trapped in Morocco with no chance of moving forward or getting international protection.

Ticket to an imagined Eden

He told me about the preparations for the attack, the migrants’ tactical mistakes, the reasons for their failures. He and others, separately or in small groups, had tried to scale the fence many times in the past. Some succeeded. Most failed. They were spotted and chased away by border guards. This time, they had decided on a “mass strike” to overwhelm the guards with their numbers. This was to be their ticket to the imagined Eden behind the fences.

“We approached the fence,” he said, and paused, remembering details. “The Moroccan soldiers saw us. They were scared of our numbers. They were shouting, calling for help.” More soldiers arrived and the shooting started. “They were shooting rubber bullets. Some Moroccan soldiers used real bullets. We continued to climb the fence. People were screaming.” There was chaos. Men ran in every direction. Some were trapped between in the space between the fences. “Some people lost their legs or arms.”

Amid the chaos and the shooting a few succeeded in climbing the fences. They were in Ceuta, free. Their freedom ended abruptly minutes later when plainclothes police spotted them: “They pulled out their guns and shot in the air.” They were arrested and immediately deported back to Morocco.

Showdown in Melilla

In a bare room in a poor suburb of Rabat, Blessed Freedom, 23, a migrant from Guinea, recalled the developments that had led to the attack in Melilla. A few nights before, many Africans had entered the enclave. The Spanish and Moroccans reinforced their forces and sent helicopters to patrol the area. That did not stop the migrants. Both the authorities and the migrants were preparing for war, a last showdown. On the night of 6 October more than 500 migrants charged the fences. The soldiers shot into the crowd and killed six. A hunt began across northern Morocco with raids, arrests and deportations. “We did not succeed that night because we were not coordinated,” said Blessed Freedom. “We didn’t think they would shoot, or at least not with real bullets. But they did. Some of us ran back to the woods, others tried to climb over the fence. God helped me survive.”

Would he try again? “The fence is 18 feet, very high. We’re not afraid of the height, we’re afraid of the shooting. I won’t try again.”

He and many others took refuge in Oujda, 40 miles east of Melilla and a short drive from the Algerian border. They camped in an open space enclosed by a high wall and a metal gate that belongs to the law faculty at Mohamed 1er university. Then he and a few compatriots trekked for days along the railroad tracks towards the city of Fes. There he rested and recovered, before hopping on a train to Rabat. Not long after, he was arrested.

He was taken to the Algerian frontier and dropped on the other side. In Algeria, Blessed Freedom was arrested again, robbed by soldiers, then let go. He trekked back to Morocco, to Oujda and the barren patch of land by the university campus. It has sparse shrubs and small trees, casting small patches of shade, but none of the tents or cardboard and tin homes found even in the most deprived refugee camps. The sub-Saharans sleep on gravel and dirt and the summer heat is intense. As they did in the woods, the migrants live in two groups: French-speakers close to the entrance, English-speakers at the far end.

A small space serves as a mosque and is separated from the rest of the area by small rocks placed neatly next to each another. The Muslims among the migrants keep the area cleared of garbage and dirt, and the others respect the empty shrine. They walk around it, and avoid littering the area of prayer. A similar small square of land on the other side of the camp serves as a church for the Christians.

The camp is not entirely protected. At night, away from the watchful eyes and protection of the university students, the police frequently raid the camp, take the migrants to the border and drop them on the Algerian side. Algerian soldiers arrest them, strip them of all their belongings, and deport them back to Morocco. They make their way back to the campus. To escape arrest, many leave the camp after midnight. Blessed Freedom said: “I would sleep in the nearby woods until daybreak because the police always raided the campus around four or five in the morning.”

Quartier Vietnam

Away from the camp on the opposite side of town, a Liberian migrant, Moses, is in his seventh year of banishment. He lives alone on the margins of Quartier Vietnam. Twice he succeeded in entering his promised land, Melilla. Twice, he was arrested and deported to Morocco. He is disillusioned and too weak to make a fresh attempt.

Quartier Vietnam is a ghetto in Oujda, watched by the police because of its drug trafficking and crime. The ghetto was given its name in the 1970s after fights between local youth and the police, according to Hicham Barka, the young founder and president of the Association Beni Znassen pour la culture, le développement et la solidarité. The association, originally founded to help children living in the ghetto, gives humanitarian aid to migrants trapped in Oujda.

Late one afternoon I visited the quartier with Hicham Barka, over a dried stream filled with mud, dirt, plastic bags and garbage. Goats grazed in the filth and children played football amid flies and mosquitoes. Moses joined us. We climbed past the ghetto up to an open field where young men mixing hashish and tobacco invited us to share the fat joints they were preparing. We stopped by a decaying motorcycle saddle on the ground. “This is my home, Mr Man,” said Moses, offering us the seat. I sat on the ground beside the seat. Moses squatted.

It was getting dark. The heat had given way to a cool breeze. Dim light blinked from the glassless windows of the homes behind the stream. The silence was broken by the occasional sound of cars on a nearby road as Moses told his tale. He had left Liberia in 1999 when civil war devastated it. “My family does not know where I am, Mr Man.”

A fresh wound on his shaved head caught my attention. A week earlier, a gang of Moroccan youths had attacked him for no reason. Moses downplayed the assault. This was not his first experience of violence. Most of the scars had disappeared. What remained and deepened were the psychological wounds of seven years of displacement. Moses looked anxious. As he spoke, the expression on his face changed. His earlier smile disappeared. The redness of his eyes seemed more intense. At times, he was incoherent. When a friend arrived and engaged in conversation with the others, Moses continued to speak, louder, without a break, begging to be heard, repeating himself.

“I have talent, Mr Man,” he said. “Do you know Bob Marley? I can sing like him. I play the drums. I just need a sponsor. I have to go to Europe. My talent is dying here, Mr Man,” he told me, competing with the other conversations around me. “I am tired, Mr Man. I’m confused. I don’t know what to do. Look at where I live. I live like an animal. Africa has problems,” he said and began to cry.

Poor and illegal

What Moses told me was common among the migrants. Because of the difficulties of the journey and the loss of hope, especially after autumn 2005, many are resigned to making Morocco their home. Illegal, impoverished, harassed by a government trying to deal with its own economic problems, the migrants have precarious lives. Finding work in Morocco is impossible. Many Moroccans are unemployed and live in poverty. Nearly 17% of the country’s 30 million people live on less than a dollar a day; 60% are illiterate. The official unemployment rate is 20% and many more suffer from underemployment, or are not counted in the statistics. So begging on the streets or asking for help from the few existing charities is the only option for the migrants.

The psychological effect of prolonged displacement adds to their chronic health problems. Many show symptoms of depression. Dr Kalonji Tshisekedi, a Congolese radiologist and university professor currently working in Morocco as part of an exchange programme, has treated many cases of schizophrenia among migrants in Rabat since 2005.

The situation is even more critical for women, who are most affected by the hardships of the journey. Hicham Barka said sub-Saharan women are physically abused by human smugglers along the journey, and male migrants treat them as sex slaves once in Morocco. Prostitution is common: they sell their bodies for as little as 50 cents, the price of a meal in Rabat. Hicham Barka also claims that in some cases the smugglers have impregnated women and kept them in Morocco until they gave birth, when the babies were sold to couples in Europe wanting children.

The men offer the women as bribes to border guards. “Passing through Algeria we had women with us and we had to sacrifice them to the Algerian soldiers,” a Congolese told me. “There are many ugly things on this road. This route is the route of evil,” said Blessed Freedom.

Dr Tshisekedi, alone, has taken care of the medical needs of many sub-Saharan women stranded in Rabat. He has gained the trust of the community, and is one of the very few people the migrants allow to visit their living quarters. He told me the women’s main problem is routine sexual violation. Penniless and unable to move on, the women live with the men in overcrowded rooms. Fifty sub-Saharan men and only one woman lived in a room that Dr Tshisekedi visited; she was passed around by the men. He said that some women tried to get pregnant in the hopes that the men would leave them alone and begged the men to allow them an hour or two of sleep a night. “Many of these women accept that they are the men’s common property. They are used to this. They have no choice,” said Dr Tshisekedi. Those who refuse are often tortured. A young English-speaking woman showed him the cigarette burns on her body.

Aids, tuberculosis, hepatitis and other diseases are common. One young woman took condoms the doctor had distributed and handed them out to the men whose room she was sharing, to avoid being infected with HIV. Such precautions don’t exist for most of the men and women.

On my last day in Rabat I visited a sub-Saharan dying in a public hospital in Rabat. His shrunken body was covered by a brown blanket. His eyes were fixed on the ceiling, he was breathing hard and waiting to die. He was alone, with no family in Morocco and no friends to visit him.

I ended my search in Casablanca, Morocco’s largest city and chief port. On a hilltop facing the Atlantic, along Kennedy Boulevard with its expensive restaurants and clubs, is a palace hidden behind tall walls, built by the Saudi royal family for occasional holidays. Close by is the Hassan II mosque, the world’s second largest, which attracts a large crowd of worshippers every Friday.

I watched them enter in small groups, chatting, and noticed a tall, slim, dark-skinned African standing before me with his right arm out and his palm open, a request for money. “Salaam aleikum” ­ peace be upon you ­ the African said. “Aleikum as-salaam,” I replied, reaching in my pocket for change. Suddenly a mob of Moroccan beggars, dirty children and adults of all ages, rushed towards me. An old man pushed the African away angrily. Looking for him through the moving hands and bodies, I gestured him to stand aside and wait. Giving the old man the change in my hand, I walked to the African, standing alone on a corner, watchful. “Where are you from?” I asked him in English, giving him what money I had left. “Ivory Coast,” he replied. Nathalie Darries had told me in Tangiers: “On a Friday the sub-Saharans don’t come to the clinic even if they are sick. It is their best chance to beg for money and feed themselves.”