Crouching in a bush, barely daring to breathe, the undercover RSPCA man had a group of badger baiters in his sights.

From his hiding place, Sussex-based Tony Saunders could see the three men digging furiously to reach their prey.

He could also hear the barking of a terrier that had been sent below ground to tear into the badger. They were only 20 yards away.

For more than a decade, Tony had dreamed of capturing Geoffrey Verril, the leader of this gang.

He had befriended some of the gamekeeper's associates and had learned where and when they were planning to dig.

The police were ready to swoop the moment they received his order. He tried to radio and realised there was no signal.

Then disaster struck. A lurcher dog sensed someone was hiding in the bush and began barking furiously. Verril came over, shotgun in hand.

Tony - not his real name - is no ordinary RSPCA officer. After training with the SAS, he became the organisation's first undercover agent on a mission to save animals from cruelty.

He infiltrated ruthless badger-baiting and dog-fighting gangs and travelled all over the world on the trail of an international animal smuggling ring. Now, as Verril approached, it looked as if he was about to be shot.

When I meet Tony to discuss Baiting The Trap, the book he has written about his job, he is casual about the risks he has run.

Thinking back to that moment in the bush, he says: "I suppose I was in danger. He could have pretended he thought I was a fox around his pheasant pens and let go with his shotgun. He would have had a good defence, no doubt."

In the event, Verril decided there was nothing there and angrily dragged the dog away. Tony managed to crawl out of sight and earshot, raised the alarm and the gang was arrested.

But it was a close shave and not the only one that Saunders has survived in his 13 years with the RSPCA's covert Special Operations Unit.

The 42-year-old investigator has battled animal cruelty across the country and lied about his identity to gain the trust of criminals. Sometimes his cover has been dangerously close to being blown.

On one occasion, he was told four badger diggers he had interviewed in his previous job, as a uniformed RSPCA officer, were about to arrive at a farm where he was posing as a potential terrier buyer.

Hurriedly, he made his escape - and only just in time. He said: "I got to the end of the farm drive and these guys were just turning into it. I missed them by seconds. They were a really violent team. They used to beat up landowners and all kinds of stuff."

Saunders talks about the people he has exposed with cold detachment but some of the sights he has witnessed are truly shocking.

Britain, supposedly a nation of animal lovers, has more than 2,000 badger diggers, he says, along with 100 active dog fighters and 100 cock fighters.

Once, he says, the RSPCA even came across evidence of a dog fight that had been held in a child's bedroom. Blood was still spattered across the Postman Pat wallpaper. He added: "It shows what the mentality of these people is."

Now Saunders has decided to stop undercover work, although he said he would continue to run surveillance operations.

The fact he is backing down will come as a relief to his wife and their two grown-up children.

His wife, he admits, didn't know exactly what his job entailed - until she read his book. He said: "She didn't know I was getting in with these people so it was a bit of a shock to her. She was partly annoyed that I hadn't told her and quite worried."

Baiting The Trap by Tony Saunders is published by Simon and Schuster, priced £16.99.

Anyone with information about wildlife crimes should contact the RSPCA and ask for the Special Operations Unit on 0870 5555999.