A sex offender abused a fellow prisoner after the pair were forced to share a cell at Perth Prison.

Jack McKay was placed with his 28-year-old victim because of a lack of alternative options within the prison, Perth Sheriff Court heard.

On July 7, after four months sharing their cell, McKay, 61, pinned his victim to a bed and sexually abused him, the court heard.

Both the prosecution and the defence said questions had to be asked about the prison's decision to place the two men in a cell together when McKay was known have a 40-year history of sexually assaulting younger men.

Solicitor Gary Fowlis, defending, said: "I question the wisdom of housing Mr McKay with someone like the prisoner they did house him with, given his history.

"I know there are problems with housing protection prisoners in Perth and I don't think the powers that be in the Scottish Government are prepared to spend the money to deal with it.

"I am not making any excuses for his behaviour but I do question the wisdom. The prison would be well aware of Mr McKay's history and I would have thought a single occupancy cell would have been the way forward."

Fiscal depute John Malpass said McKay's victim was more than 30 years younger than him and was serving a sentence for crimes of dishonesty and drug offences. He had no history of sexual offending.

"I understand the court may be concerned, given the accused's history and with him being on a sexual offences prevention order, that he was placed in a cell with a vulnerable prisoner," the fiscal said.

"That has been canvassed with the Scottish Prison Service in relation to the facts which were apparent to them but at the time they had no other accommodation available," he added.

McKay, from Dundee, was jailed for 32 months earlier this year after he repeatedly confronted his paper boy naked from the waist down.

It is understood he was only wearing a Dundee United shirt on some occasions.

When he entered Perth Prison in March he was placed in a cell with a 28-year-old man who was unknown to him.

They initially got on but on July 7 McKay sexually assaulted the younger man.

McKay's first sexual offence was committed in 1976 and he has more than a dozen convictions of a similar nature since, including two from the High Court.

He is considered to be a danger to the public and was made the subject of a sexual offences prevention Order in 2012.

Sentence was deferred by sheriff William Wood.

A spokesman for the Scottish Prison Service said: "We do not comment on individual prisoners."