A prison officer had his throat cut by an inmate at HMP Nottingham, the Ministry of Justice has said.
Union officials said it was an “unprovoked attack” by a prisoner with a razor blade.
The officer, who was assaulted at about 10:00 BST, needed 17 stitches. He has since been discharged from hospital.
Michael McKenna, 25, has been charged with grievous bodily harm with intent, wounding with intent and a racially aggravated public order offence.
The prison’s governor said his thoughts were with the officer, his family and “the team dealing with the fallout.”
Prison Officers’ Association national chairman Mark Fairhurst said of the attacker: “Apparently as soon as his door was unlocked this morning, he attacked the first officer he saw with a razor blade.
“He has cut his neck. The officer has gone to hospital and received 17 stitches.
“At the hospital, staff said he’s lucky to be alive as it was very close to the main artery on his neck.”
Mr Fairhurst added the officer was a new member of staff, still on his probationary period.
Last year the government was ordered to make immediate improvements at the jail after a report warned it was in a “dangerous state”.
The prison needed to do “much more” to tackle the problem of drugs which was “inextricably linked” to violence, chief inspector of prisons Peter Clarke said in his report.
HMP Nottingham is a category B male prison which expanded in 2010 to hold 1,060 prisoners.