The officer with two years service at Maghaberry prison was seriously injured and bled quickly as prisoners surrounded her.
She was given emergency first aid at the scene and was transferred to the Ulster Hospital for surgery this afternoon, Belfast Live reports.
A source at the jail said: “This young officer had told a prisoner yesterday that he needed to tidy his cell as it was in a dreadful state.
“Yesterday he spat in her face and told her to f*** off.
“Today when she was on the landings, she walked past him and he side-swiped her at arm’s length with what we believe was the lid of a can of food, possibly a Fray Bentos lid or smaller.
“There was blood everywhere. She grabbed her neck and the blood was pouring out and her colleague, an other female, raised the alarm and raced to administer first aid.
“Colleagues estimated she must have lost around two pints of blood to a very deep wound.
“A couple of centimetres further down her neck and she would have bled out of her jugular and died within minutes.
“It is a dreadful attack on a young woman trying to do her job under very difficult circumstances and I can say we feel very lucky tonight that she is still alive.
“But now she will carry the physical and mental scars of this attack.”
Adrian Smith from the Prison Officers Association, said: “The woman has a three-inch gash below her left ear on the neck, it’s a pretty deep wound.
“Anybody knows the difficult and dangerous job that prison officers do and it’s getting more and more dangerous with cuts to prison service budget and staffing levels.
“Unfortunately things like this will happen more often.”
A Prison Service spokesperson said: “A prison officer has suffered a serious injury following an assault by a prisoner in Maghaberry this afternoon.
“The Prison Service utterly condemns this attack and has referred the incident to the PSNI.”