It is a clear spring evening on the wild north-west coast of Ireland. Atlantic waves surge into a wide bay surrounded by open countryside. In a field close to the beach, 200 police officers are inching their way along a high metal fence as a crowd of about 100 protesters closes in, some pulling chains from under their jackets as they prepare to attack the fence. A mile up the road, police roadblocks have been stopping cars from approaching the site since late afternoon.

Welcome to Rossport, a small but divided village in County Mayo that has become yet another battleground for Shell. The fuel giant agreed this week to pay almost £10m to settle a legal action with human rights protesters in southern Nigeria, after being accused of collaborating in the execution of nine leaders of the Ogoni tribe, including the writer Ken Saro-Wiwa. In Rossport, it is up against a group of protesters who have now held a gas pipeline at bay for almost a decade. This summer, Shell is due to put in place a massive security operation to help finally bring the pipeline ashore to its Bellanaboy Bridge gas refinery, a couple of miles inland from the village.

Standing in his garden looking out across the pipeline route, Noel Philbin sums up the anger and defiance of those who say they will never give in to Shell. "Everything is wrong with the pipeline. It's unsightly, there'll be chimneys blowing up 365 days a year and effluence pipes going back into this beautiful bay. Once they get the pipeline ashore, the battle will be here in our village. We'll do everything we can to stop that pipe and we're not afraid of going to jail, it's as simple as that."

When gas was discovered 50 miles off the deprived north Mayo coast in the Corrib field, local people thought the area would be getting prosperity and jobs. Indeed, many still support the project - they say the protesters are a small and vocal minority who oppose Shell for ideological reasons. The supporters also claim that they are afraid to speak openly, so deep are the divisions in the community.

In 2005, five men were jailed for refusing to allow Shell on to their land. The jailings sent waves of rage through the community. After three months, Shell backed down and withdrew the injunctions - and also dropped its original pipeline route. Now a new route that skirts the village is proposed and the final public hearing is under way. Once that is over, the Irish Planning Board will make the final decision, but for now Shell is pressing on with the work, determined to bring the pipe ashore.

Activists from across Ireland have been arriving to help locals launch attacks on the Shell site, attempting to tear down fences at the place where the pipe will be brought ashore. At one of the weekly demonstrations, local people - some in tears - scream abuse at police officers. But not far beneath the surface, the village is as traumatised as it is defiant. This is a community that all sides agree will struggle to recover from the bitter divisions over the pipeline.

Philbin thinks the damage done by the dispute has gone too deep to mend. "Even if Shell pulled away in the morning, this village would never get back to the way it was. There can be no harmony, no trust here ever again."

The tension in the area has been increased by allegations of assault made by a long-time opponent of the pipeline, farmer Willie Corduff. He claims that while protesting peacefully under a truck on the Shell site, he was severely beaten by a group of men in balaclavas.

Corduff was one of the men jailed in 2005. An unlikely activist, he has lived in Rossport his entire life. With his wife Mary and their six children, he works the farm his father built out of peat bogs 60 years ago. "I was stretching my legs after lying so long under the truck when about six men in balaclavas appeared, hit me over the head, then knelt on me, blocking my throat and badly beating me," he says. He has photos that show him lying in hospital, swollen and bruised, and says he is preparing evidence with a lawyer before he approaches the police.

Shell denies that anyone assaulted Corduff on its behalf, instead claiming that a balaclava-clad gang attacked its property that night with a digger, causing millions of euros' worth of damage. The security firm Shell is using to protect the site, I-RMS, adds that its only concern that night was with Corduff's welfare. Even Archbishop Desmond Tutu has weighed into the debate, expressing his concern for Corduff and backing him in his fight against the pipeline. Whatever the truth of the night of 23 April, it lit a fuse under the simmering tensions in the area.

The Irish minister for communities, Eamon O Cuiv, visited the area after the alleged attack on Corduff and faced a furious meeting of more than 300 local residents, who swore to stop the Shell work. O Cuiv said the level of anger made a strong impression on him: "I know the area well and I am very saddened by the divisions there. I do think the community should have been consulted more fairly, and I believe mistakes were made right at the beginning."

At his farm, Corduff looks broken by the long fight: "This has ruined our lives." He waves a pile of papers. "If we didn't have this pipeline coming, we wouldn't know all the things we know now, about pipeline explosions and pressure of gas."

However Paddy Cosgrove, leader of the Corrib Pro Gas group, says the majority of the community believes the project will benefit the area: "This is about bread and butter - education for our children and jobs for the future." He says those who support Shell are too afraid to speak out. "We are avoided by people who were our friends; people say things, there is intimidation."

One of the local priests, Father Kevin Hegarty, also complains of verbal abuse and intimidation towards the people who work with Shell. "The protesters have engaged in overt or silent intimidation of people who are supportive of the project. This is a close-knit rural community and that kind of intimidation can be soul-destroying. In terms of intransigence, there are similarities with the Troubles."

But accusations of intimidation are rife on both sides. "You don't know who is walking the streets at night," says Philbin. "We have two fears here. The first was the pipeline. Now, it's how they bring the pipeline in, what extreme measures will they go to. Who will be next to get a beating?"

In a further twist, when mentioning their fears about who might be working as security officials in the area, many villagers point to the recent death of the Irish security guard Michael Dwyer in Bolivia. Dwyer was shot dead by the Bolivian authorities, who claim he was involved in a plot to kill President Evo Morales. He had worked previously on the Shell site in Rossport - as had at least one of the other men with him in Bolivia, though none worked for the security firm I-RMS there. Shell insists it has investigated I-RMS and has found no evidence of any wrongdoing. I-RMS says it vets and trains all staff to national and international standards.

John Egan, Shell's head of communications in Ireland, blames the need for security on the acts of violence and intimidation on their site by protesters. "We would rather work without security, but the constant attacks on our site mean we have to use a level of security that is not usual on building sites in Ireland. [The security guards] work responsibly in the face of constant provocation and abuse."

Egan knows more than most the damage community opposition can do to an energy giant, having been the BBC's correspondent for Nigeria in the 1990s. He says he is a County Mayo man and passionately believes in delivering the project - for the benefit of Ireland and the region. "It's vital for Ireland that Shell are seen to succeed here. The delays here have been very bad for Ireland internationally."

It is easy to sympathise with the protesters, looking out across the untouched beauty of this remote corner of Europe. There is a visceral horror of the industrial complex at Bellanaboy Bridge and the dangers of a gas pipe explosion. But the Kinsale gas fields that provide Ireland with its gas are close to running out.

Vincent McGrath, a well-known local accordion player and historian, is a spokesman for Pobal Chill Comáin, the main group representing locals. It believes Shell can still be persuaded to compromise and move the pipeline route and refinery further away. McGrath says that what is at stake in Rossport is worth more than the price of gas: "We are fighting for many things here: our health, environment and happiness. But we are also fighting for the right to live our lives as we have for generations before Shell came along."

McGrath has a glint in his eyes and smiles as he promises that Shell will not get their way. "Shell do not have the consent of this community. And the lesson of history is that where there is occupation, there will be resistance."