A violent inmate punched a member of staff in the head at a prison in Leeds.
Mark Walker, 28, assaulted the custodial manager as he was being led to a new cell at Wealstun prison.
The unprovoked attack took place at the Category C prison near Wetherby on the morning of August 29 last year.
Prosecutor Stephanie Hancock said prison officers were alerted to Walker being assaulted in his cell and removed another inmate from the cell.
The decision was made to transfer Walker to a resettlement unit.
Walker put some of his belongings into two bags and was escorted through the wing by officers.
Miss Hancock said the defendant was aggressive and made threats to fight other prisoners.
A female custodial manager tried to calm him down during the walk.
Walker dropped one of his bags on the floor and went to pick it up but then suddenly attacked the woman.
He struck her in the head and as she fell back he struck her two further times.
Walker was taken to a segregation unit after the incident and the officer received treatment on the medical wing.
She was off work for 30 days after the attack.
In a statement, she described how it was the worst incident of violence she had experienced in 15 years as a prison officer.
Walker, of no fixed address, pleaded guilty to assault occasioning actual bodily harm.
Phillip Morris, mitigating, said Walker has schizophrenia and he had no access to his medication on the day of the incident.
Judge Penelope Belcher adjourned the hearing so evidence of the barrister's claim can be obtained.
Walker's sentencing was listed for April 1.