A child rapist who carried out sex attacks on two women after he was freed early from prison may never be released.

Andrew Anderson, 34, was out on early release after raping a 13-year-old girl when he sexually assaulted a woman as she slept beside him.

Anderson, who is assessed as a high risk of causing harm to the public, then went on to rape another woman.

At the High Court in Glasgow, judge Lord Armstrong ordered Anderson to be placed on an order for lifelong restriction and set the punishment part at five years.

But he told Anderson: "You must not assume you will be released at the end of that sentence.

"You will only be released when you are no longer considered a danger to the public."

Anderson smirked as he was led away to the cells.

Lord Armstrong added: "You continue to deny your guilt and take no responsibility for your actions.

"You are indifferent and callous towards the two women and have no understanding of the effects of your actions have had on them."

Anderson was jailed in 2006 for the rape of the 13-year-old girl.

He was sentenced to six years in prison and two years monitoring in the community after his release.

He was released early in 2010, with two years of his sentence still to serve.

Just two weeks later he raped a sleeping woman, who reported it to police but there was not enough evidence to proceed.

He was later recalled to prison on another matter and ordered to serve the rest of the six-year prison sentence he received for the first rape which took place in Kilmarnock.

Anderson was released in 2014 and raped another woman some time between 2014 and 2015.

That victim said she had known Anderson since she was a schoolgirl and was frightened of him because of a campaign of sexual abuse going back 14 years.

Between 2002 and 2003, when she was about 14, he touched her inappropriately.

More than a decade later, at an address in Kilmarnock, he pinned her down and raped her.

She didn't report what had happened to police immediately, but he showed up at her home with a hammer last year, she contacted them and revealed he had raped and sexually assaulted her.

Detectives then questioned woman who were in relationships with Anderson and uncovered the rape from 2010.