Prison staff feared their colleague, locked in a room and being attacked by crazed extremists, was facing the same gruesome death as murdered soldier Lee Rigby.
The terrified officer, in his 30s, was finally freed by a specialist riot squad who stormed the room where he was held for five hours and beaten mercilessly by the extremists, who told him he would die.
And the vicious assault was sparked by a simple call from a prison imam to pray for drummer Lee who was butchered in the street last week near his barracks in Woolwich, South East London.
The ringleader of the prison attack flew into a rage at the request, insisting the 25-year-old’s murder was justified.
Recruiting two fellow Muslims, an African-born fanatic and a British convert, they kidnapped the guard on Sunday and bundled him into a cleaning room at Full Sutton jail near York.
Once inside, he was battered senseless with mop handles. The yobs threatened to pour caustic toilet cleaner into his eyes.
A prison source said last night: “The fear was that the gang had somehow got hold of knives from the prison kitchen and they would attempt to behead him.
“It was organised and inspired by the terrible death of Lee Rigby. The ringleader wanted to start a riot and after taking a hostage he was shouting for ‘true Muslims’ to join a holy war.
“By the time the attack finished the officer was covered in bruises and blood.
“He feels very lucky to be alive. He was told they would kill him.”
The guard was taken to hospital with serious injuries. He is believed to have been allowed home to recover but is expected to be off work for several weeks.
Staff at Full Sutton, which holds dozens of terrorists, said they had warned bosses about the ringleader’s volatile temperament and insisted he was an increased security risk.
They had wanted him moved into a segregation wing. But they claimed their pleas were ignored as jail chiefs did not want to risk stirring up trouble.
A source said: “We could see this was coming but nothing was done.
“The bosses were too worried about causing offence among terrorists to do their job properly.
“And as a result, we are very lucky not to be dealing with the death of a prison officer.”
The three attackers were bundled into segregation units after being overpowered at the maximum security jail.
The Prisoner Officers Association confirmed the latest incident had taken place.
And a spokesman said severe cuts in the number of guards has sparked fears of more attacks.
He added: “We are seriously concerned about dangerous staffing levels in prisons.
“The POA believe future cuts will massively increase the risk of violence.”
The Prison Service also confirmed the attack took place.
A spokesman added: “It was successfully resolved. A police investigation is ongoing.”