He turned up with long hair, tattoos and an insatiable appetite for climbing trees. Few people suspected anything odd of the man who introduced himself as Mark Stone on a dairy farm turned spiritual sanctuary in North Yorkshire.

He had come alone on 12 August 2003, in the middle of a heatwave, for a gathering of environmental activists known as Earth First.

Apart from the fact that "Stone" was apparently well-paid and ate meat, he appeared no different from the hundreds of other activists who gathered under marquees to smoke weed, play guitars and plan protests.

What no one could have known was that, despite appearances, the 33-year-old "freelance climber" was actually PC Mark Kennedy, an undercover police officer beginning an audacious operation to live deep undercover among environmental activists.

The Guardian can reveal just how successful – and controversial – the operation was.

From that day Kennedy would live a remarkable double life lasting more than seven years. So embedded in the protest community did he become that about 200 people turned up for a joint celebration of his 40th birthday, described as a "three-day bender" on a farm.

All were, of course, oblivious that Kennedy was feeding back detailed reports to his police commanders as he participated in, and sometimes even organised, some of the most high-profile demonstrations of the past decade.

He took part in almost every major environmental protest in the UK from 2003, and also managed to infiltrate groups of anti-racists, anarchists and animal rights protesters.

Using a fake passport, Kennedy visited more than 22 countries, taking part in protests against the building of a dam in Iceland, touring Spain with eco-activists, and penetrating anarchist networks in Germany and Italy.

It was a career that involved breaking into power stations, invading airports and – according to legal papers – concluded in an operation in which he now stands accused of crossing the boundary from spy to agent provocateur.

Kennedy's personal journey also appears to have ended with a remarkable twist. In recent weeks, after protesters discovered his hidden identity and circulated news that he was a police agent, Kennedy is said to have "gone native". He has expressed remorse to betrayed friends and is seeking some way of securing redemption.

Kennedy's career as a police constable in the Metropolitan police began around 1994. It was almost 10 years later – in early 2003 – that he was selected as a candidate for a classified operation.

Police have been infiltrating protest movements for decades, but Kennedy was to be one of the first to work for the newly formed National Public Order Intelligence Unit, which monitors so-called "domestic extremists".

That summer he was issued with a driving licence and passport bearing his new identity – Mark Stone – and a plausible backstory that explained his long absences. Claiming to be a professional climber, Kennedy told people he encountered in Nottingham – many of them connected to Earth First – that he often had well-paid work abroad.

Kennedy had two assets that, in the years to come, would make him indispensable to protesters. First, he could drive, and had a dark blue pick-up truck. Second, he was generous with his money, agreeing to pay for campaign literature, rented vans and fines imposed on activists in magistrates courts. His largesse would eventually earn him his best-known nickname, Flash.

Almost a year after he first emerged in Nottingham, Kennedy began gaining the trust of activists. In 2004 he became involved in Dissent!, a network preparing for protests against the following year's G8 Summit in Gleneagles.

In 2005 he scaled trees in London, to hang a banner protesting against BP, then travelled to Scotland, where his van was used to ship equipment to an eco-camp near Stirling. After G8 came to an end, Kennedy vanished to Iceland to campaign against the construction of a dam.

He was becoming well-known among protesters, including Alex Long, a member of the London-based Wombles anarchist collective, who had met him the previous year.

Looking back, Long said, Kennedy was "too good to be true – the perfect activist". "He would be your best mate, but not in a contrived way," he said. "If he walked in right now, I'd say to him: 'Mark, how you doing?' and then only seconds later I'd think, oh, I forgot, you're a cop."

By all accounts Kennedy rarely expressed political views, instead taking an interest in the practicalities of protest.

Craig Logan, 37, who unwittingly became a close friend of the undercover officer, said he had "no great powers of oratory" but made friends quickly. "He was funny, friendly – if a bit blokey," he said. "He would go out of his way for people." He agreed that Kennedy's van – and his money – quickly helped him to ingratiate himself with the community.

Conscious of police surveillance, activists keep those who know about the logistics of a protest "action" to a small circle. For practical reasons, those in the know typically include people responsible for transport.

By the summer of 2006, Kennedy's life as an activist was complete. He entered the circle of people planning the first of the annual Climate Camp gatherings, helping to set up the encampment near the Drax coal-fired power station in North Yorkshire. Around the same time he chained himself to Hartlepool nuclear power station and climbed a crane at Didcot power station.

At the following year's Climate Camp, Kennedy was trusted enough to be given the important role of organising transport needed to set up a camp near Heathrow.

But by Climate Camp 2008 – when activists gathered near Kingsnorth power station, in Kent – the undercover police officer's appetite for action was raising suspicions. Kennedy volunteered to be the driver in an action that saw 29 activists successfully hijack a train delivering 1,000 tonnes of coal to Drax. Behind his back, some protesters began calling him "Detective Stone".

"I was quite shocked," said Long. "That is just about the worst thing you can say about an activist."

It was not until 12 April 2009, when Kennedy's uniformed colleagues stormed into a school in the suburbs of Nottingham, that his double life began to unravel.

Police had been tipped off – presumably by Kennedy – that some activists planned to break into the nearby Ratcliffe-on-Soar power station, a coal-fired plant owned by E.ON. In a £300,000 operation police swooped into a school building where protesters had gathered on the eve of the invasion.

Inside, they found 114 activists including Kennedy, who had travelled from the London G20 protests. Twenty protesters were eventually convicted for the minor crime of conspiracy to commit trespass after they admitted they had planned to occupy the plant for a week, thereby preventing the emission of 150,000 tonnes of carbon.

Handing down "lenient" sentences last week at Nottingham crown court, a judge said the intended protest would have been peaceful and safe, and recognised the activists were "decent" people with "the highest possible motives".

Kennedy, it seems, was the exception. For four months he had played a key role in planning the action, leading a reconnaissance mission and giving advice on the best way to break into the site.

"We needed someone who could drive and we needed someone we could trust. Mark felt like that person," said Bradley Day, 23, who worked with Kennedy on the mission.

Kennedy allowed his house to be used for planning meetings and, days before the protest was due to take place he used his fake ID to pay £778 to hire a 7.5-tonne truck to transport equipment. Those around said they became increasingly aware of his desire for the protest to go ahead.

When a heavy police presence was reported outside the power station, activists considered abandoning the protest, but nominated Kennedy to drive out to see how big a threat they posed. When he returned, he told the group there was no police presence at all. The arrests followed soon after.

Immediately some suspected Kennedy, who may have been having his own regrets. "I remember being awake at about eight the next morning and seeing Mark sitting at the bottom of the stairs with his head in his hands," said one activist who slept on Kennedy's floor.

Suspicions grew when Kennedy – among 27 activists who were charged – declined to use the same law firm as the others. Charges against him, but not the others, were then dropped. But it was a chance discovery of his real passport, bearing the surname Kennedy, months later that put activists on a trail that would eventually lead them to documents confirming he was a police officer.

Six of Kennedy's close friends confronted him in a house in Nottingham in the early hours of 21 October last year. He confessed, breaking down in tears and expressing regret for the pain he had caused. He told those present that he was not the only officer deep undercover in the protest movement, costing the taxpayer £250,000 a year per agent.

Those claims – along with his apparent remorse – were not believed by everyone present. "He is duplicitous. He was undercover for seven years. I didn't trust a word of what he was saying," said one activist.

Kennedy is now living abroad, but recent developments suggest his desire for redemption is sincere. In email exchanges with activists and their lawyer, Kennedy talked of taking a "leap of faith", giving the defence evidence that would "assist" them. "I want to help," he said.

Three weeks ago, Kennedy suddenly pulled out and ceased communications, but not before expressing an abiding concern. "I don't want this ever to happen to anyone ever again," he said. "What's happened is really wrong."