For generations, the people of Erris have been farming and fishing along the remote coast of County Mayo. When gas was discovered offshore, Shell pounced. But it hadn't bargained for the unyielding resistance of the community

If the sea is calm, you can hear the traffic in New York," goes the local introduction to the breathtaking beauty of Erris, in the north of County Mayo, where the coastline winds its way through little coves and beneath the cliffs of the wild seaboard at Europe's edge. Most nights, though, Manhattan must be quiet, for the only audible sounds are the distant baying of a dog several miles away, the soft bleating of newborn lambs from lush coastal meadows and the sighing of the brine as it moves across rocks and shingle.

Soon, however, this deep peace will be shattered forever. "And this is where it all began," says Willie Corduff, standing in his farmyard atop fields that tumble down to the estuary of Sruwaddacon. Corduff's family have farmed here for generations. "It's been hard," he says, "but we've made a living doing a little bit of everything, you know – a little suckling, a little silage, a little hay." Now that way of life stands to be destroyed, along with that of Corduff's neighbours, who fish the Atlantic waters as their forefathers have for centuries. Right across the estuary from Corduff's farm, where meadows and bog once came down to the sands, diggers now chug and churn the earth and security men strut behind the reinforced fencing in fluorescent "hi-viz" jackets. After dusk has fallen, what was once the pure darkness of night is pierced by floodlights. A mile behind this "exempted development" that needs no planning permission, a refinery has been built, heavily guarded, a gash across the land inflicted by lights, concrete, fencing and those ubiquitous fluorescent jackets. The Shell oil company has come to Erris – and how.

"It was a Scottish fellow came one morning," says Corduff. "And you know, it was the arrogance that triggered me off. There was no asking. He told me what was going to happen, taking me for a fool."

In 1996, a reserve of gas had been found 50 miles offshore by a consortium called Enterprise Energy Ireland and a major stake was bought by Shell in 2002. The plan has been to bring raw, untreated gas ashore by pipe, to the refinery at Ballinaboy, six miles south of the estuary. The pipe is to come ashore at Broadhaven Bay's widest and loveliest point, and was to skirt the estuary's northern shore, through farmland. "There's miles of empty bog out there," says John Monaghan, one of the leaders of the ensuing protest, "and they chose to take it across the farms. Where there are farms there are farmhouses, and where there are farmhouses there are families."

The arguments were made: successive government ministers insisted that what became known as the Corrib gas project would decrease Irish dependency on imported Scottish gas and provide up to 60% of Ireland's needs at peak periods. On the other side, there were immediate environmental concerns: Broadhaven Bay and nearby Carrowmore Lake are EU-designated Special Protection Areas; the lake, near the refinery, provides drinking water. There were concerns about potential explosions and the initial high pressure (345 bar) at which the gas would be piped ashore, and the fact that, as raw gas, it contained impurities, and would be corrosive. And there were issues of history and community.

Maura Harrington, a retired teacher in the village of Inver, who is one of the protest's most outspoken voices, says: "This is about a sense of place and its people. We may not qualify as indigenous people, but we have our land and culture, to which we belong. All those people who emigrated from Erris through history, Erris never left them. They say we are opposed to progress, and laugh at us. But to me, progress is the ability to sustain yourself, and those who come after you. It's nature and nurture: what we here call muinhin, which means of the place, and cointeann, which means to get a little awkward when that place and its people are about to be torn apart."

'I’d be a fella who loved a quiet life': fisherman Pat O’Donnell with his daughter Aisling at Glenamoy. Photograph: Murdo MacLeod for the Observer

There had been a choice in Ireland about what to do with the "new frontier" – abundant natural gas off its western shores. There were two models: that of the Norwegians, who guaranteed a state-owned stake in exploitation and quota for domestic consumption, and that of British North Sea gas, where profits were largely spirited away by multinational companies. The Norwegian model was favoured by the Irish minister for industry and commerce during the 1970s, Justin Keating, who judged that Britain was wasting resources while Norway was securing its future. But the tide turned, as Keating's notions of state responsibility were swept aside by enthusiasm for the free market and Margaret Thatcher's handling of North Sea gas.

In 2000, Enterprise began digging holes for the pipeline through farmland in Rossport, and was granted planning permission by Mayo County Council for the refinery at Ballinaboy. The following year the Irish government awarded itself the right to statutorily acquire the private land it needed – the first consent orders issued by former minister Frank Fahey on election day in May 2002.

Enterprise, and later Shell, had courted Irish politicians – and the affair was reciprocated, with entertainment for oil executives in Fianna Fáil tents at Galway races – but everyone in the loop was dealt a blow when County Mayo's permission for the terminal was appealed to the national planning board, Bord Pleanála. The planning inspector, Kevin Moore, recommended refusal, concluding that: "From a strategic planning perspective, this is the wrong site. From the perspective of government policy which seeks to foster balanced regional development, this is the wrong site. From the perspective of minimising environmental impact, this is the wrong site; and consequently: from the perspective of sustainable development this is the wrong site."

Enterprise Oil was taken over by Shell soon after, and the minutes of a meeting of the company's managing directors laid out a plan for how to deal with Moore's objections. "The Committee", read the minutes, "queried whether the Group had sufficiently well-placed contacts with the Irish government and regulators" and "undertook to explore this issue further". In December 2003, Shell went back to Mayo Council and residents again appealed to the Bord Pleanála. This time a new director approved the plan.

Farmers across whose land the pipe was due to run were offered compensation. Some took it, but six owners of smallholdings along the route refused – one of them was Willie Corduff. In response, the Irish government passed, in 2005, the first ever legislation allowing a private corporation the same rights of compulsory purchase afforded to a state agency. Still Corduff and his fellow small farmers refused to admit Shell on to their land. "I think they thought they could break our spirit," he says. "I don't think they realised what kind of people they were dealing with. I think they thought we were farmers with 2,000 acres driving Jeeps, not people struggling on a little bit of bog, making it greener by the yard with a shovel." Corduff keeps his cloth cap on as we retreat to the kitchen of his farmhouse, where he explains how he became one of the first of many to go to jail.

In April 2005, Shell secured interlocutory orders against those refusing to let company agents on to their land. On 29 June, five people, including Corduff, were arrested and tried for contempt of the order, and jailed for 94 days. "When the judge said I was going to jail," says Corduff, "what little bit of hair that's upon my head was sticking up on end."

Corduff and his colleagues became known as the "Rossport Five", and the case of Shell's Corrib pipeline became a cause célèbre across Ireland. Now, the story of the uprising that followed has been made into a film, The Pipe, which is picking up worldwide awards, with queues around the block to watch screenings in Bucharest, Phoenix, Boston, San Francisco and New York – as well as Galway and London.

The director is Risteard O'Domhnaill, just past 30 years old, who at first covered the dispute as a news cameraman for the Irish-language television service and whose uncle farms sheep and cattle between Inver and the Erris coastline. He was appalled by the way in which many of his peers reported the story: "There was a culture of 'don't rock the boat' – the media had got caught up in the Celtic Tiger business, ready to round on anyone who criticised development, or deregulation – in this case, anyone who questioned what was happening to my uncle's community."

Security guards attempt to move an anti-Shell activist. Photograph: Murdo MacLeod for the Observer

The Pipe, says O'Domhnaill, "is Local Hero gone wrong" – it is also a vivid, close-range narrative of a battle unfolding, and a cruel parable of our times.

"People talk about us as though we want to be going back to the Stone Age," says Corduff. "But those people who farmed here with a donkey and cart and a bucket, they handed it on to their children. If this thing goes ahead, we won't be able to do that. They say we're standing in the way of progress, but what is it we're standing in the way of? We're standing in the way of the place being polluted and destroyed by Shell, that's what. They say we're enjoying ourselves with this protest. But we're not – it's a terrible sadness, the whole thing."

The imprisonment of the Rossport Five and nationwide demonstrations in support of them led to the formation of Shell To Sea. One of the most prominent figures in the protest alliance is Maura Harrington, who spent a month in jail for slapping a police officer in the face. On another occasion, she says: "I refused to pay a fine, went to jail for 13 days and saved myself ¤2,700." When a first attempt was made to lay the pipe at sea, Harrington went on hunger strike for 10 days.

"My mother was one of the few women for the time to have gone to the University of Galway, and my father was a trade union man, so he'd have been politically aware," she says, by way of introduction over a pub dinner in the homely Western Strands Hotel near Belmullet. "So I'd have been brought up this way… But in the end the cause of Shell To Sea is brutally simple: to oppose an assault on the air, the land, the sea and its people – and on the nation of Ireland. Shell tries to obfuscate things with environmental-impact statements and spin, but in the end it comes to this: will the traitors who govern this country allow such an assault to succeed, or will we stop it? Will raw gas come ashore to be refined and sold abroad to enrich a multinational corporation, or will it not? In a world of spin and virtuality, this is all very real – I don't want to sound all Marie Antoinette, but when you are living close to the land, air and sea, you are living in the real world."

Not everyone in the community opposed the project, as Shell and the Irish government point out. Father Kevin Hegarty of the neighbouring parish of Kilmore draws on a line from The Playboy of the Western World – set in these parts – to describe O'Domhnaill's film: "'It's a great story and he tells it lovely, but he doesn't tell the whole story. I'd say the majority of this community supports the project. It's a way to provide employment and an opening towards the development of sustainable fuels in Ireland." (Father Kevin's colleague Fr Michael Nallen, in Kilcommon itself, opposed the pipeline.)

There is argument over how many jobs the project would create: a spokeswoman for Shell, Denise Horan, says 450 people are currently employed, with "several hundred" more jobs to come with the building of the pipeline. "When the project is in operation, there will be approximately 130 full-time jobs," she says. There is also some debate as to how much the gas will benefit Ireland. Ms Horan says: "All the gas from the Corrib field will be consumed in Ireland," and that gas cannot be exported to the UK because the pipe runs one way; but O'Domhnaill insists that "there's no compulsion on them to serve Irish interests; in the end, they can sell it wherever they like, at whatever price they like – that's how it is with the multinational oil companies."

In June 2008, the Irish government gave Shell permission to begin laying its pipeline at sea and the biggest pipe-laying vessel in the world, the Solitaire, arrived to do so. The challenge to this colossus by a fisherman named Pat O'Donnell, his family and supporters, bobbing about on the ocean with the bows of the Solitaire towering above, makes for the most compelling and heart-breaking passage in O'Domhnaill's film.

The fishermen's battle against Shell begins heart-warmingly with O'Donnell saying to the camera: "Isn't it a lovely sight when you see all the fishermen together and fighting for the one thing?" But soon, it becomes a battle that turns fisherman against fisherman, as Shell offers money to those prepared to relinquish their fishing rights.

The scene climaxes with a remarkable piece of real-life action cinema as O'Donnell – in his little fishing boat, the John Michelle – and two other ships confront the immense Solitaire bow to bow. "I've a right to fish here," says O'Donnell of his lobster pots, but warships of the Irish navy arrive to ensure the Solitaire's way.

They call O'Donnell "The Chief" for miles around the lovely hamlet of Porturlin where he lives, and it is quite an honour to clamber aboard the John Michelle with him. "If I lived to be 100, I'd never sell this boat," says the Chief. "This is history, this boat.

"I was born in 1957," says Pat, "second youngest of 11 children. All my sisters emigrated to the United States at a young age, but we five boys stayed behind to fish, for the sea has been good to our family. I tried a while in London, in construction, but had to come back – I missed the sea; I'd known at a young age what I wanted to do for the rest of my life, and my oldest, Jonathan, was skipper of his own boat aged 15 – he's 26 now."

He continues: "I'd be a fella who loved a quiet life," but that aspiration ended after the fishermen's group he initially mobilised against Shell commissioned a scientist at Southampton University, Dr Alex Rogers, to survey the impact the pipeline would have on their livelihoods, the stocks at sea. Dr Rogers concluded pessimistically, and, says O'Donnell, "after all I'd read about Shell in Nigeria, who'd want them here as well?" He joined the protest movement blockading the contract workers' access to the refinery site.

"'People have the right to go to work,' we kept being told, but Pat O'Donnell and his son, who have the right to fish at sea under a ministerial licence were arrested for setting their pots," he fumes. "I'd never think I'd see the day when the Irish navy would turn its guns on Irish citizens fishing Irish waters, for the sake of a British and Dutch company."

O'Donnell served two jail sentences totalling seven months, only to watch most of the other members of his protest flotilla take Shell's silver, one by one. "One of them turned his boat into a portable toilet for men working on the jack-up rigs. How low can you get? What a way for a good fishing boat to be ending up, shifting shit for Shell!"

On 11 June 2009, O'Donnell claims his other boat, Iona Isle, was boarded off the western tip of Broadhaven Bay by "four masked men with guns, who went down below. All I could see was their eyes and their mouths. They came up some minutes later, vanished and I noticed the boat was water-heavy. I put out a Mayday call and had 20 minutes to get into my life craft. I wasn't right for a good while after, for it's a terrible thing for a fisherman to lose his boat in such an attack. I tried to get insurance, but the broker told me I wasn't covered for acts of terrorism." The police and the IRMS security firm contracted by Shell have both denied involvement in the sinking of the boat. Barrister Brian Barrington investigated the incident and that said as the boat was sunk at sea it was impossible to verify the claim.

On the shoreline at Glengad, above Broadhaven Bay's widest sweep, is the spot where the pipe hits landfall. Above this wild, wondrous foreshore is a standing stone circle. "It goes back to the first farmers on this land, and beyond," says O'Domhnaill as we clamber up the hill for a better view of the ocean sweep. This is where the pipe will come ashore, after which it will run overland beside the stone circle, beneath the estuary to Rossport, and journey overland to the refinery. It is here that Shell has been obliged to reduce the high pressure at which the gas will come ashore, but those who live here remain exposed to what they believe – despite Shell's assurances to the contrary – is the weakest joint, and most potentially dangerous point, in the process.

Above the site and just below the stone circle is the home of John Monaghan, who formed a group that split from Shell To Sea's absolute opposition, supporting instead a compromise route, proposed by local priests, across open, uninhabited bog at Glinsk, to the north. Its name was Pobal Chill Chomáin, People of Kilcommon. The rift is plain to see in O'Domhnaill's movie: the sad, inevitable, bad-tempered rupture of the vulnerable – neighbour pitched against neighbour – when faced by the giant.

Monaghan grew up in Nottingham, but "came back in the 1980s, to the family roots. And it's changed even since then. When I came back, they were still bringing in turf by horse and cart. Now, the Celtic Tiger has come and gone, and attitudes have changed – more selfishness, boom or bust. Bust, as it turned out. Shell is riding the tiger's back, the idea that greed is good, all development is good, end of story, no questions asked."

Corrib, says Monaghan, "is an entirely new approach – the 'sub-sea tie-back' system that brings in dirty gas and refines it ashore. And the idea of compulsory purchase orders by the private sector is also totally new. Also, I wonder if they've figured a worst-case scenario into their risk-assessment calculations, as I'd always do as a civil engineer. I was open to the idea at first, but we never got a glimpse of the reality. There's been zero accountability."

O'Domhnaill's film, as it reaches critical mass, becomes a vortex of images of how the pipeline's route has been forged: police officers and security men confronting protesters and their sympathisers at every turn.

"We keep being told 'the law must be upheld,'" says Monaghan. "But whose law? Shell's law. It might be called the law, but it's not justice. There is no way we can get justice. Even if there's a judicial review, we're liable for costs if we lose, and they'd break us. The law is that whoever has the money gets their way. Look at them! Navy warships patrolling, people coming up the beach from inflatables, moving through the village with video cameras filming us, police officers beating people up, Jeeps roaring around with number plates removed and no tax discs. And that's the law? If there's one thing I've learned from all this, it's that justice and the law are mutually exclusive."

"The Garda?" Corduff asks. "We put trust in them, used to have craic with them, our kids used to stay over at theirs. Now, if the children see a squad car or a paddy wagon, they'll be running off into the bog. That's a sad thing."

The fenced-in work beneath Monaghan's house is another "exempted development" without planning permission – which Shell argues is unnecessary anyway, as the pipe follows a route authorised at ministerial level. Even so, disruption to the family of Colm Henry, a few fields along from Monaghan, has been, he says, vulgar and extreme.

Henry is a soft-spoken man who plays country music in a band which tours Ireland and the UK. His walls are hung with Native American artefacts he brought back from visits to Arizona. "It's the most unspoilt stretch on the west coast," says his gracious wife Gabrielle, peeling potatoes. "There aren't even many tourists, and when they do find it, we ask them: 'Please don't tell anyone.'" "We used to go about our business in peace – we were left alone," says Henry, "and we would be using the beach in all weathers, swimming in summer and walking in winter."

When Shell's security dispatch invaded Glengad, they did so "with van loads of men", recalls Henry. "All night long there were heavy-duty lights directed at our home – even with the curtains drawn the house was illuminated. You had 50 cars and vans outside, floodlights and a cameraman sitting on the mound filming us in our house and on our own land."

The worst intrusions came, says Henry, "when they started filming the children walking on their own family land. My grandchildren went to play on the beach; they'd be changing to swim, when the security would be photographing them. Now I think that if I was to be filming children undressing on a beach, I might be ending up on the front page of a tabloid newspaper. But no – they can do what they wish, with impunity. Going around in balaclavas, no ID, they even have gloved hands, Jesus you can't even tell the colour of their skin – and they're very cosy with the Garda." When Henry tried to file a complaint at Belmullet police station, "the Super said he felt bad as a family man, like, but there was nothing he could do, it was out of his hands. When I made my statement about harassment, I didn't get so much as the courtesy of a reply from the Garda" – though he did secure back the pictures of his grandchildren changing clothes. "It makes me wonder: who are these people invading our lives and filming our children?"

Ms Horan of Shell said: "We reject the suggestions of heavy-handedness by the security company. IRMS is a reputable company. Their staff are trained to deal professionally with protesters and show them respect." She added: "The main reason we need to have security on this project is to allow our employees to go about their legitimate work and to protect our sites and our equipment." Staff had been "verbally abused, intimidated and prevented from entering their place of work. On one night alone, in 2009, ¤75,000 of damage was done." IRMS was not answering its telephone in County Kildare last week.

The question of official policing of the Corrib pipeline by the Garda made front-page headlines again last month, when tapes emerged of Garda officers joking about raping women protesters. Demonstrations culminated in one outside the Garda station at the Mayo County seat of Castlebar, home town of the new Taoiseach, Enda Kenny. One of the shamed officers had been transferred here, to a desk job. It was fitting that the demonstration was held in Castlebar, for it was here that Michael Davitt, the son of Mayo who inspired the protest movement, formed the Land League in 1879. Davitt mounted a highly effective campaign against big landowners, leading to the right of tenants to buy their land.

Erris is steeped, then, in the ravages and resistances of Irish history, so the protesters are even more aware than most Irishmen and women that the centenary of the 1916 Easter Rising is nigh. For them, the moment is charged with meaning. There is a heart-wrenching passage in O'Domhnaill's film when Pat O'Donnell, arrested, removes and furls the tricolour from the aft of his fishing boat. "The principles of the tricolour were wiped out when they did that to us," spits the Chief now. "People died for that flag and its principles, and if those men knew what was happening now, they'd be turning in their graves."

"I was in the third boat behind the Chief that day," says John Monaghan. "When he took down the tricolour, I felt it, too: they betray everything that was said in the proclamation of 1916, and the constitution. Then the guard puts his hand on the Chief's shoulder and says: 'I'm arresting you now, lad.' It's a seemingly kind gesture, but it's the kiss of Judas."

Mary Corduff, Willie's wife, laments that: "Everyone knew that a certain amount of money would split people, especially in a poor community." None of those who took money from Shell are willing to talk publicly. One man, who sold land for road widening, said simply, as we chatted in a Spar petrol station: "It's best if I'm not making a big thing of it all."

"People still talk to each other," continues Mary, "but it's not the same as before Shell came. All we do now is talk, sleep and eat Shell. You put up another Christmas tree, and all that has happened since you put up the last one is Shell, Shell, Shell. We haven't the life we used to, when between Christmas trees you'd hope to be getting in a bit of silage and have some hay drying."

John Monaghan looks back a couple of weeks to "a day when we were coming out of the depths of winter; the sun was shining through the window, the kids getting ready for school. It all looked so beautiful, the shore down there, the sea and a blue sky – but there they were: the Jeeps, the jackets, the cops, the navy, the choppers and diggers. This is deep stuff, it spoils the sunshine".

The Pipe is on More4 on 14 June at 10pm