For four years, Officer A lived a secret life among anti-racist activists as they fought brutal battles with the police and the BNP. Here he tells of the terrifying life he led, the psychological burden it placed on him and his growing fears that the work of his unit could threaten legitimate protest

An officer from a secretive unit of the Metropolitan police has given a chilling account of how he spent years working undercover among anti-racist groups in Britain, during which he routinely engaged in violence against members of the public and uniformed police officers to maintain his cover.

During his tour of duty, the man – known only as Officer A – also had sexual relations with at least two of his female targets as a way of obtaining intelligence. So convincing was he in his covert role that he quickly rose to become branch secretary of a leading anti-racist organisation that was believed to be a front for Labour's Militant tendency.

"My role was to provide intelligence about protests and demonstrations, particularly those that had the potential to become violent," he said. "In doing so, the campaigns I was associated with lost much of their effectiveness, a factor that ultimately hastened their demise."

His deployment, which lasted from 1993 to 1997, ended amid fears that his presence and role within groups protesting about black deaths in police custody and bungled investigations into racist murders would be revealed during the public inquiry by Sir William Macpherson into the death of south London teenager Stephen Lawrence.

His decision to tell his story to the Observer provides the most detailed account of the shadowy and controversial police unit that has provided intelligence from within political and protest movements for more than four decades. He believes the public should be able to make an informed decision about whether such covert activities are necessary, given their potential to curtail legitimate protest movements.

Officer A – with a long ponytail, angry persona and willingness to be educated in the finer points of Trotskyist ideology – was never suspected by those he befriended of being a member of the Special Demonstration Squad (SDS), a secret unit within Special Branch, whose job is to prevent violent public disorder on the streets of the capital. Known as the "hairies" due to the fact that its members do not have to abide by usual police regulations about their appearance, the unit consists of 10 full-time undercover operatives who are given new identities, and provided with flats, vehicles and "cover" jobs while working in the field for up to five years at a time.

The unit has been credited with preventing bloodshed on numerous occasions by using intelligence to pre-empt potentially violent situations. Unlike regular undercover officers, members of the SDS do not have to gather evidence with a view to prosecuting their targets. This enables them to witness and even engage in criminal activity without fear of disciplinary action or compromising a subsequent court case.

Officer A joined the SDS in 1993 after two years in Special Branch. It was a time of heightened tension between the extreme left and right and almost every weekend saw clashes between the likes of the Anti-Nazi League, Youth Against Racism, the British National party and the National Front. The SDS is believed to have infiltrated all such organisations.

During Officer A's time undercover, all 10 covert SDS operatives would meet to share intelligence about forthcoming demonstrations. The information was used to plan police responses to counter the threat of the demonstration getting out of control.

A key success for Officer A came just two weeks into his deployment during a demonstration against the BNP-run bookshop in Welling, south-east London. His intelligence revealed that the protest was to be far larger than thought and that a particularly violent faction was planning to storm the bookshop and set fire to it.

As a result of intelligence provided by Officer A, police leave was cancelled for that weekend and, despite violent clashes, the operation was deemed to be a success for the Met. The then commissioner, Sir Paul Condon, met the members of the SDS to thank them.

• In this video, Rodney King is referred to as an 'innocent motorist'

but we should clarify that he was driving while under the influence of

alcohol and had led the police on a high-speed chase because he was on

parole for a previous robbery conviction. None of this justifies the

beating he received.