At around midday on 1 July, the police officers watching from a tent on the mountain observed the suspect cradle a sick kitten in his arms. “He’s called either Zig or Zag – there are two of them,” said Cédric Herrou, gently applying eye drops to the cat. “I’m not sure which this is.”

Herrou, a 38-year-old farmer, was kneeling beside a wooden shelter on a hillside in south-eastern France. Tents, caravans and rudimentary toilet blocks nestled among the nearby olive trees. At first sight, it could have been a hippyish holiday camp with Herrou – dressed in a purple T-shirt and jeans, with thinning hair, a ponytail and a packet of Natural American Spirit rolling tobacco poking out from his back pocket – as the manager. But the shelter’s pillars were covered in the hand-drawn flags of Ethiopia, Eritrea and Sudan. At a long table, a group of young Sudanese men were reciting French verbs. Then there were the police.

Herrou stood up, let the kitten go and took me to the edge of his hill, which stuck out from one side of a steep valley in the southern Alps a few miles from the border with Italy. A fast-flowing river ran through a rocky gorge below, peaks loomed over us from all sides and the smell of pine trees carried on the breeze. “You see that blue tent there?” he said, pointing to one of the mountain tops. “You can see them watching us.” I could just make out a figure in a dark uniform, whose exposed white forearms were holding something up to his face. “Another tent there, and another tent there,” Herrou said, pointing to mountains on different sides of the farm. “Three posts, they change over four times a day, three or four people in each post – so that’s 40 people a day, paid to put me under surveillance.”

Herrou put both of his hands to his mouth, whistled loudly and waved. The white forearms dropped suddenly, and the figure disappeared into the tent. Herrou was putting on a show. Many journalists, volunteers and well-wishers have made their way up the hill to Herrou’s farm since his arrest last year for helping undocumented migrants cross from Italy into France, either to claim asylum there or continue their journeys to other destinations in Europe.

“If we have to break the law to help people, let’s do it,” he told a crowd of supporters outside his trial in Nice in January. Herrou’s defiance of the authorities has given him a kind of celebrity. But this is also a story about France, about a pattern that has become common in Europe: how the state absents itself from a crisis, leaves volunteers to fill the gap, and then cracks down and imposes divisions when it doesn’t like the results.

***

For 15 years, Cédric Herrou has tended chickens and grown olive trees at his farm in the village of Breil-sur-Roya, in the valley of the River Roya. For most of that time, he paid little attention to the international border that snakes through the valley from the Alps to the Mediterranean Sea, separating a string of French villages from Ventimiglia, the Italian town 15 miles south of Breil, at the mouth of the river.

Crossing that border is part of Herrou’s daily life, he explained to me, as we sat at one end of a long table. “You have to understand,” he said, “it’s not like in my head I go to one country, I go to another. When I buy chickens, I go to Ventimiglia. If I go to the beach, I go to Ventimiglia. Ventimiglia, the Roya valley – it’s chez moi.”

The same is true for many other people who live around Ventimiglia, which sits on the Riviera, the stretch of the Mediterranean coastline that runs through Cannes, Nice and Monaco and into Italy. The town is home to Italians who work in France and French commuters who take advantage of the cheaper Italian rents. French day-trippers visit the Friday farmers’ market. All of them benefit from the Schengen Area, Europe’s “borderless” zone of free movement. Yet the town’s fortunes have become intimately linked with the continent’s refugee crisis.

In June 2015, as a growing number of migrants from Africa and the Middle East were passing through Italy on their way to elsewhere in Europe, France imposed ID checks on the rail and road routes at its border near Ventimiglia, using a provision in the EU’s Schengen Agreement that allows states to introduce partial, temporary controls in cases of emergency. After the Isis-directed attacks in Paris in November that year, which killed 130 people, France sent many more police officers to patrol the border zone. As a result, Ventimiglia has hosted thousands of people left destitute as they try to find a way to leave Italy. Different groups of migrants use different routes and methods to travel. Most of those who get stuck at Ventimiglia are refugees from Eritrea and Sudan’s Darfur region, travelling without the money to pay smugglers and following the footsteps of others they know who have taken the journey – some after months or years in Italy, others within days of arriving.

Local officials have been reluctant to fund aid efforts or set up accommodation, not wanting to attract more migrants to the town. Instead, the task of feeding, sheltering and treating the medical needs of the migrants has fallen to volunteers: from individual well-wishers and political activists to religious groups and humanitarian NGOs. The Italian state has allowed the Red Cross to set up a temporary camp on the town’s outskirts but demolishes and evicts unofficial camps, issuing court orders banning volunteers from distributing food and rounding up migrants to send them to reception centres in the far south of the country.

At the end of 2015, frustrated by the continuing crisis, Herrou began to drive migrant children he found in Ventimiglia across the border to France, dropping them off at train stations so they could continue their journeys, or sheltering them at his farm and helping them claim asylum locally. “For me,” he said, “it’s unbearable that minors, kids, [and] families with two-year-olds risk their lives to cross the border.”

He wasn’t alone. One local activist I spoke to described half a dozen others who regularly took vulnerable refugees across the border in their cars and suggested that there had been many more who did it as a one-off. In the summer of 2016, Herrou was arrested near Breil while transporting eight Eritrean migrants in his van. Charges of facilitating illegal immigration were dropped on the grounds of “humanitarian immunity”, but the case caught the attention of a New York Times reporter, who wrote a piece about Herrou that autumn.

“People ask how it is that I’ve become a symbol of aid to migrants,” Herrou told me. “But it’s not migrants I help. Most people would not let someone sleep outside on their doorstep. They would say, ‘No, come inside.’ Me, my doorstep, the road, the village square – it’s the same for me.” He claims to have ferried 200 people across in the past year and a half.

***

Several days before meeting Herrou, I visited Ventimiglia. I had been given the name of a bar whose owner was known for assisting migrants. I found it on a side street near the station. Italian locals were sitting in a row at the counter drinking coffee, while young men of African and central Asian origin came in and out, handing their phones to the staff, who plugged them into various chargers at one end of the bar. The owner, a small, stern, middle-aged woman called Delia, told me that hers was the only bar in Ventimiglia that allowed refugees in. “Maybe they’re a little too bronzati [tanned] for the others,” she said sarcastically.

This was the third summer in a row that the number of people sleeping rough in the town had risen. The Red Cross camp had been closed for refurbishment and around 500 people, mainly Sudanese, had been living under a motorway flyover and along the banks of the Roya estuary. The week before my visit, police had demolished the encampments and, when the migrants staged a protest and walked along the river towards the border, tear-gassed the demonstrators.

A young man, seeing my notebook, came up to me and asked if I was a journalist. “Can you tell me why France doesn’t let people claim asylum there?” he said. He was 22 and from Cameroon, and asked me not to print his name. He had come to Italy after taking a boat from Libya, and the Italian government had issued him with temporary ID documents. In theory, these should have allowed him to travel: Schengen rules allow non-EU citizens with residence permits to visit other countries in the zone for up to 90 days. Many migrants in Italy have used this loophole to travel elsewhere and claim asylum, even though the system asks them to make their claims in the country of arrival.

But France had been using its temporary controls to turn back migrants without passports. “I’ve tried to cross six times,” said the young man, explaining that he had been to the Swiss border crossing at Lake Como but couldn’t get through there, either. He had tried to take the train from Ventimiglia to Nice but had been arrested when it crossed into France. “The police checked our papers, held us in a cell overnight, then made us walk back to Italy, like they wanted to punish us,” he told me.

During my stay, I had seen how the police conducted their checks. They boarded at Menton, the first stop in France, walked the length of the carriage and asked the black people on board to show their passports. (A case brought by five French citizens of African origin, who claim that they were racially profiled when temporary border controls were in operation during an earlier movement of refugees in 2013, is being heard by the European Court of Human Rights.) I had also seen a steady stream of rejected migrants making the walk back along the road from France, alone or in small groups.

Earlier that day, an Eritrean woman asked me for drinking water. She had been walking for three hours in the summer sun.

***

At Herrou’s farm, one of the kittens watched a hen as it pecked at a bowl of food, close to where we were sitting. The shelter has a kitchen area and Joseph, a man from Sierra Leone with a bleached Mohican, was preparing lunch. “He’s head chef,” Herrou said. Most people move on from his farm within a few weeks, but a few have stayed on to help run the camp. Herrou said he thought as many as 1,500 people had passed through since 2015.

In the autumn of that year, a few months after France started to police trains leaving Ventimiglia, migrants began to arrive destitute in Breil and the other villages of the Roya. Blocked from taking the main routes into France, they were heading into the mountains, following the old smugglers’ pathways that criss-cross the region. Residents would emerge from their houses to find people wandering the streets tired, disorientated and suffering the effects of their journey: hunger, thirst, scratches and bruises, cold or heat exhaustion. Many have been giving the migrants food and temporary shelter – then, not knowing what else to do, driving them down to Herrou’s farm, where he had made space available.

In response, Herrou said, the French government put the area under lockdown, using the state of emergency declared after the Paris attacks. Checkpoints were set up on every road from Italy and on many roads between the villages. Schengen rules allow a state to return people who have crossed a border without permission to its neighbour if they are found within 20 kilometres (12 miles) of the border and the Roya valley falls within this zone. “People cross the border, they’re in France, but they’re not really in France because they don’t have the opportunity to access their right to claim asylum,” Herrou told me.

This leaves migrants and the residents who help them in a bind. Those refugees who want to claim asylum must do so 40 miles away in Nice, which is outside the zone. If they reach Herrou’s farm, he can contact the prefecture and make an appointment, but if they go by themselves, they’ll be arrested and returned to Italy. Residents are allowed to give them food or shelter, but if they drive them anywhere, they risk being charged with facilitating illegal immigration, a crime with a possible prison sentence.

The result is that while Herrou’s farm is left alone, the surrounding area is heavily policed. “If I take a black person in my car, they stop me,” Herrou said. “If a car drops people off at mine, it’ll be stopped. Sometimes at night, they have one roadblock in front of my farm and one behind it. But they never come on to the farm. It’s crazy. It’s as if we’re a principality like Monaco here.”

Herrou is part of a network of villagers, perhaps 200 in total, who shelter migrants and organise food runs to Ventimiglia. Many have leftist sympathies – although they are not, as Herrou says of himself, necessarily “card-carrying” – and they have continued to do their work even as members have been arrested and put on trial. As one member, a retired hospital worker, told me: “It’s like the campaign for abortion rights. If this many people are breaking the law every day, the law needs to be changed.”

But the Roya valley, an area of modest means where public services and agri­culture are the main employers, reflects France’s political polarisation. The Front National has strong support here: in the presidential election in May, around half the voters in Breil backed Marine Le Pen. Many do not support their neighbours’ activism and people regularly phone the police anonymously to report the presence of migrants, or those transporting them. Perhaps mindful of anti-immigration sentiment, the previous French president, François Hollande, appointed a hardliner as prefect (chief of police) of the surrounding region. While the new president, Emmanuel Macron, has spoken of the need to welcome refugees with “talents” needed by the French economy, his interior minister, Gérard Collomb, has set out a no-tolerance policy at Calais and presided over evictions of migrants sleeping rough in Paris.

Herrou believes that these policies are creating the problem that they purport to solve: people are hiding and living without papers rather than trying to claim asylum. “The far right says, ‘Close the borders and refuse all the requests for asylum’… The border here is closed and I have a hundred people a week arriving. A border does not close. It is managed. Whether one is for or against the migratory flow, the solution is the same. We’re not saying accept everyone. We’re saying start by accepting the law because the law is intelligent.”

In late 2016, Herrou stopped smuggling migrants across the border from Ventimiglia because, he said, he would rather help put pressure on France to follow its laws and give migrants the right to claim asylum than be accused of doing anything illegal. “It’s like I’ve said to the police when they’ve arrested me: I’m a farmer. I’m not a lawyer, not a judge. Maybe I’m wrong, and everything I’ve done is illegal and foolish – it’s possible. But either I have the right or I don’t, so either arrest me or let me continue.”

***

In Ventimiglia, the young man from Cameroon played me a song on his phone. “That’s mine. I’m a rapper,” he said. In his home town, he had supplemented his income by selling CDs at a market. He had left, he said, because a neighbour to whom he had lent money had reported him to the police for sexual assault instead of paying back the debt. He was tired of waiting for Italy to process his asylum claim and he wanted to try France instead, where he knew the language and he had a better chance of finding work. “I just want a normal life,” he said. “If I had no problems, I wouldn’t have left my country.”

Was he a refugee? In public debate, crude distinctions are often drawn – between Syrians as “genuine” refugees, for example, and the rest as “economic migrants” – but the reality is more complex. The 1951 Refugee Convention, the founding document of our international system, defines a refugee as a person with a “well-founded” fear of persecution, owing to their race, religion, nationality, social group or political views. (Further treaties define protection for people fleeing war zones.) Being accused of a crime isn’t usually enough to merit asylum.

Then again, it would depend on the details of the case. If the young man came from a particular ethnic group, or if he was mixed up in politics, too, that might have just been enough. The basic principle of refugee protection is that each person’s case is to be treated on its individual merits. To do that, you need a functioning system in which people can reach safety, claim asylum and have their cases heard quickly and fairly.

By the time people reach Ventimiglia, this system has failed. Since 2014, between 150,000 and 170,000 people a year have been arriving by boat in Italy, mostly via Libya. They come from a range of countries mostly in West and East Africa, but also from the Middle East and, more recently, Bangladesh. They are a mix of those escaping war and dictatorship in their home countries, people who have travelled to Libya for work and are then forced to flee civil war and the widespread abuse and exploitation of black men and women in that country, people risking the trip through Libya in order to reach Europe in search

of a job, and those trafficked against their will to perform sex work for European customers. Italy’s asylum system has struggled to accommodate, register and assess these people, and its EU neighbours are no longer willing to help: a scheme agreed in September 2015 to relocate 160,000 refugees from Italy and Greece was recently wound up with its target reduced to 33,000.

The result is a growing category of people whose rights and legal status are unclear as they try to move around Europe. Italy calls them transitanti, migrants in transit. They live in limbo, caught in the cracks of Europe’s complex asylum system and border regime. Yet the response of European governments has largely been to act as if these people, who don’t officially exist, shouldn’t exist. When they get stuck at crossing points, or geographical bottlenecks – not just Ventimiglia, but Calais, Greece’s Aegean Islands, the Greek port of Patras, or Belgrade and other places in the Balkans – they are beaten back, or detained, or denied support. Local citizens who help them are discouraged or, in many cases, criminalised.

The human cost of these measures is becoming apparent. Last October, a 17-year-old Eritrean girl was killed by a lorry on the motorway outside Ventimiglia. At her funeral, the local bishop said it was “Europe’s hypocrisy” that had killed her. Since then, looking through local news reports, I have counted at least 13 migrant deaths in and around Ventimiglia: four people killed on the roads; six hit by trains or electrocuted on the tracks; two swept away in the River Roya, including a teenage boy; one suicide.

The arrests of European citizens are starting to stack up. In Italy, activists have been issued with court orders banning them from Ventimiglia for as long as three years; 31 face trial for the illegal occupation of a building in the town. In January, a university researcher in France was tried and acquitted for having transported three Eritrean migrants; in June, four retired residents of the Roya valley were convicted and fined for a similar action. In October 2016, Herrou was arrested for transporting migrants again, shortly after he led villagers to occupy a disused railway yard near Breil that they wanted to turn into a shelter for migrants. The case was taken to trial: in February, Herrou received a suspended fine of €3,000 from the court in Nice. Local officials have been critical of judges’ reluctance to hand out severe punishments; the prosecutor appealed Herrou’s case and, in early August, his penalty was increased to a four-month suspended jail sentence.

***

At the farm, the chef Joseph offered us lunch: pasta with tuna and peppers. Herrou didn’t eat. He stood by the kitchen counter scrolling through messages on the screen of one phone and answering calls on another. He had an easy, jokey manner with the guests on his farm but was serious on the phone, his dark eyes looking sternly through thick, round-framed glasses.

After lunch, the photographer I was working with needed to take a portrait of Herrou, so we went into his house, a small single-storey cottage a little further down the hill. “My brother and sister-in-law helped me build the shelter up there, so I could have a bit of privacy,” he said.

We went into the living room: a rough wooden floor, two sofas, tie-dyed throws and a bookshelf. A miniature bottle of whiskey and a Teach Yourself Arabic book sat on a coffee table. Herrou used to live here with a partner and her children, he said, but they had split up and for the past six years he had lived alone.

I asked him if he was tired. “Yes, but I think I can keep going,” Herrou replied. He still had his chickens and his olive trees, he said, although he was struggling to find the time to manage the business. “I tried to get the others to do it for me while I was away, but they didn’t feed the chickens properly.”

He seemed ambivalent about the media attention. He knew that it was a reason why he kept getting arrested. “For the migrants, it’s positive. Unaccompanied migrants are taken into care, the prefect is criticised, 1,500 people who arrived here have gone. It’s not over.”

But for him, it must be frightening. “Ah ouais, oh, yeah,” he told me. “Can you imagine? I keep getting arrested and put in custody.” The week before I arrived, Herrou had been arrested as he was taking two teenage boys to play football and kept in the cells overnight. The week after I left, he was arrested again, shortly after activists released a film that he had helped make, with a hidden camera, that purported to show French police at Menton denying a young refugee his legal right to claim asylum in France.

And on 25 July, Herrou was in custody once more. After he tried to film the police at the station in Cannes, his farm was raided. In a press release that Herrou sent to me by email, he claimed that 90 people, including minors, had been arrested at the farm and returned to Italy. “I have been asking the government for a year but nobody answers me,” he wrote. “When you have 200 asylum seekers arriving in your garden, what is the solution? Who is responsible? What can we do? What can we not do? Where does solidarity end? Where does the offence begin?”

Herrou’s parents, also farmers who live locally, were worried but they trusted him, he said. Other activists I spoke to expressed concern that Herrou had got himself into something he wasn’t prepared for. “Cédric just does things without telling us, then says, ‘Follow that,’ and a lot of people don’t want to because they think it’s too dangerous,” one told me.

“What I find crazy,” Herrou said, “is that when I talk to people about how the border is closed, they say, ‘Oh, but it’s normal.’ No, it’s not. They’ve forgotten Schengen has only been 20 years, and I have the impression that one gets used to confinement more quickly than to liberty. But this is our duty as citizens in a democracy: we don’t wait for rights to come from the outside. You can go to prison for liberty.”

It was inspiring, but it also sounded like something he’d had to say repeatedly. As Herrou posed for the camera, I noticed a book about rock climbing on the shelf. “You go climbing?” I asked, and Herrou smiled properly for the first and only time during our encounter. “Yeah, I used to go three times a week,” he said. “But I don’t have the time any more.”

The reporting for this article was funded by a Migration Media Award. Daniel Trilling’s book on refugees in Europe, “Lights in the Distance”, will be published by Picador in early 2018