He admitted striking John Cowie on the body with the mop handle and behaving in an abusive or threatening manner on April 8 last year.

Duncan also admitted causing disruption at Falkirk Sheriff Court on November 10 after being told a warrant had been granted for his arrest.

The court heard Duncan and another inmate were carrying out cleaning duties when another officer asked them to speed up. Duncan started arguing and when the officer ordered him to go to his cell he refused.

Assistance was called for but he picked up a wooden mop handle and struck Mr Cowie who had gone to help his colleague.

Sheriff John Mundy was also told that, having been released from Polmont, Duncan was due in court on November 10. When he hadn’t arrived by 10.15am, a warrant was issued for his arrest.

Shortly after this he arrived in the court foyer and was told about the warrant. He became abusive and tried to get into Court 3, “causing some disturbance to proceedings which were ongoing”.

A defence agent said Duncan admitted he shouldn’t have reacted as he did to being ticked off over his cleaning.

As for his behaviour in court, he was frustrated because he’d sent a message that he would be late and this hadn’t been received by his solicitor.

The agent said Duncan is currently serving a sentence with a release date of August and asked Sheriff Mundy not to add to this. She said he has matured to an extent over the past year.

However, the sheriff imposed a 16-month jail term and said this will start when his current stretch ends.