A SEX offender lost his temper during a trial.

He screamed: "I'm f*****g out of here. I've had enough of this s**t."

Ryan Dunn, 20, then assaulted a female G4S officer who attempted to bring him under control, struggled with another security officer and kicked a chair.

The youngster will now spend the next four months at a young offender institution for his violent outburst.

The incident happened at Glasgow Sheriff Court on July 10, 2018.

Returning for punishment last week, the court was told that Dunn was handed a Community Payback Order and was placed on the Sex Offenders' Register for one year in August following the events of the trial.

Defending, his lawyer claimed that the accused had struggled with the accusations from the previous charge – which dated back to 2014.

Following many procedural hearings – and being targeted by other prisoners – Dunn was said to have not had the "emotional resources" to cope and "his anger got the better of him". He has since apologised to the G4S staff.

The defence agent explained that Dunn grew up in the care system, adding: "He's never had a role model whatsoever."

Sheriff Ian Fleming told the accused, whose address was given as HM Prison Polmont, that only a sentence of detention was appropriate.