An irate prisoner hit another inmate with a broom handle so hard his brain moved, a court heard.
Daniel Sanders, 25, lashed out with the brush after confronting fellow convict Peter McDonald.
Sanders accused him of making too much noise and locked himself in the cell with him – attacking him with a broom.
He battered him so hard his brain moved in his skull and he suffered a fit and a severely fractured skull.
Paramedics were forced to bring him back from the brink of death at Channings Wood Prison in Newton Abbot, Devon.
The victim had to be transferred to a neurological unit where he was put into an induced coma and spent three weeks in intensive care, Exeter Crown Court was told.
Sanders, of Liskeard, Cornwall, admitted causing grievous bodily harm and was jailed for 32 months by Recorder Paul Derbyshire.
Mr Derbyshire told him: “This was a very nasty assault which resulted in very serious injuries. You were both serving prisoners and there had been friction between you.
“You went to his cell and closed the door. There was a fight and you picked up a broom and hit him with such force it not only fractured his skull but dislodged the brain.
“It was such a severe depressed fracture that it shifted the brain by a centimetre for a while.
“It is extraordinary he recovered from such a serious injury. It was a significant blow and had it not been for the prompt action of those at the scene and the doctors at the hospital you would be facing a much more serious charge.”
At the time of the attack Sanders was serving an 18- month sentence for a burglary, the court was told.