A patient at Rampton Hospital admitted punching and spitting in the face of staff.
Nottingham Crown Court heard how Brian Gormley, 29, also scratched a fellow patient in a separate attack, drawing blood in the process.
Gormley pleaded guilty to three offences of assault by beating.
The court heard that Gormley suffers from a mental health disorder.
Prosecuting, Lisa Hardy told the court how, on 25th May last year, he grabbed a patient in the dining room without warning.
He then began to scratch the victim, drawing blood.
It took several members of staff to restrain Gormley as he struggled and thrashed around.
Six weeks later, staff were standing by his bed when he jumped up and punched a ward manager.
During the attack, Gormley also wrapped his arm round his victim’s head.
Gormley then spat at a nursing assistant, who said she would rather have been punched than spat at.
Gormley has previous convictions for attacks, having been given a five year sentence for assaults in the past.
The court heard that he had been given an indefinite sentence in 2009 after committing arson.
Judge James Sampson accepted that Gormley was suffering from a mental disorder.
He added that the nature and degree of the illness required his detention in a secure hospital.
The judge ordered that Gormley be detained at Rampton Secure Hospital for an indefinite period of time.