A sex offender pulled down the trousers of a serial rapist and laughed at the size of his manhood while the two were serving time at HMP Edinburgh last year, a court was told.

Ian Dempster the sex offender from Elphinstone, was said to have taken down the trousers of Jonathan Mallon to ridicule him.

Dempster was also accused of striking Mallon between his legs with a pool cue as he played the game with another prisoner at the Capital prison's sex offender wing Ingliston Hall, which houses some of Scotland's worst child abusers.

The incident was heard when Dempster had appeared in the dock for a part-heard trial at Edinburgh Sheriff Court last month. He was accused of assaulting and sexually assaulting Mallon at the prison in December 2015 and January 2016.

On Monday (7 August), when the trial resumed, Sheriff Michael O'Grady was told that Dempster was pleading guilty to assaulting Mallon at HMP Edinburgh on 2 January, 2016. He agreed that he pulled down Mallon's clothing, exposing his genitals.

Mallon, 37, in his statement said that he felt "sick, angry and upset" after claiming that Dempster had touched his genitals during the pool game and had later humiliated him by exposing him to two other prisoners.

Mallon told prosecutor Mark Keane, "I was leaning over the table to take a shot and he [Dempster] put his cue between my legs and hit my balls.

"I said that is ****ing sore, but he just laughed.

"Later I was coming out of my cell and Dempster came over and grabbed my privates with his hand. He smacked them with his hand and just laughed.

"I was angry because I thought he was picking on me as I am a gay man."

Dempster's not-guilty pleas to sexually assaulting Mallon by touching his testicles and assaulting him with the pool cue, between 1 and 31 December, 2015, were accepted by the Crown.

He was earlier jailed for three years in 2011 for committing five sexual assaults, and was ordered to be supervised for a further three years. The sex offender, however, broke his release order in 2015 by travelling to England without permission, and is currently back in jail.