His claim was supported by his trade union, Unite, and Thompsons Solicitors.

David Thomas from Northants was attacked in May 2004 at HM Prison and Young Offenders Institution Onley, near Rugby, Warwickshire while supervising inmates who had been smoking cannabis.

He was on a phased return to work after an illness and found that safe working systems appeared to have broken down. He was meant to be working with a manager but instead found himself alone with the inmates.

The group was irritable and aggressive. They accused him of being Hitler and gave him Nazi-type salutes when he tried to control them.

The situation deteriorated when he refused to allow them to use a strimmer. One inmate began to hurl abuse and the group refused to follow instructions. Mr Thomas called for assistance, which would usually arrive within minutes, but his call wasn’t answered.

He knew that he couldn’t leave the inmates alone, so he stayed with them as they became increasingly abusive.

He was then pushed against a door and sexually assaulted. He managed to get away and phoned again for help, but it took 20 minutes to arrive.

Mr Thomas was unable to return to work after the attack. He suffered nightmares, became reclusive, was emotional and tearful and lacked confidence. Although his psychological condition did improve, doctors advised that he should not return to work unless his employer ensured that he did not work on his own again.

HM Prison refused to accept this so Mr Thomas was medically retired in September 2005.

Mr Thomas said: “I had worked for many years in the Prison Service and enjoyed my job and was confident doing it. I had even earned an outstanding achievement award for helping an inmate. But things started to deteriorate when I wasn’t getting the support from managers that I needed. I had raised concerns about health and safety and inmate discipline before and had been attacked and injured by inmates in the past, which left me stressed.

“I am very angry that this terrifying assault happened because I was left alone with a group of aggressive inmates and no one came to my assistance. Even when I did get through to security they said they couldn’t help me as there was another security incident in the prison. This shouldn’t have been allowed to happen. My life was turned upside down and although I am much better now, I will never forget what happened to me.”

Gerard Coyne, Unite regional secretary, said: “Working with offenders inevitably means that our members in the prison service sometimes face dangerous situations. But what happened to David could have been avoided. His employer showed complete disregard for his health and safety by leaving him alone with a group of potentially dangerous inmates. He should have been accompanied by a colleague and his calls for assistance should have been immediately acted on.”

John Mullen of Thompsons Solicitors said: “This case shows the dangers of lone working. The Prison Service failed in its duty of care to David in allowing staffing levels to drop so that he was placed in such danger. In an age when health and safety is coming under attack, I hope this case demonstrates why regulations exist to protect workers and what can happen if they are ignored.”