Andrew Anderson (pictured) was freed just four years into a six-year sentence for raping a child when he went on to rape another woman within weeks

A dangerous sex offender who raped two women after being freed early from prison has been jailed hours after the Justice Secretary denied the SNP was 'soft' on crime.

Andrew Anderson, 34, smiled as he was led to the cells after being told he would be locked up for five years before possible parole.

Anderson was first jailed in 2006 for an attack on a the 13-year-old girl.

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

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

In 2012, he was recalled to prison on another matter and ordered to serve the rest of the six-year sentence he received for the first rape.

Anderson was released in 2014 and raped another woman. 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 he pinned her down and raped her.

When he showed up at her home with a hammer last year, she contacted police and revealed he had raped her.

At the High Court in Glasgow yesterday Lord Armstrong told him: 'You will only be released when you are no longer considered a danger to the public.'

A Scottish Government spokesman said: 'We are clear that, in every case of sexual crime, the justice system must take a victim-centred perspective and we are working with the Crown Office, Police Scotland and the Scottish Courts and Tribunals Service to ensure this happens across the board.'

Justice Secretary Humza Yousaf (pictured) was forced to deny that the SNP was 'soft' on crime

Justice Secretary Humza Yousaf had earlier yesterday told a newspaper victims would be placed 'even more at the heart' of the justice system.

And when asked whether the SNP was 'soft' on violent offenders, he said: 'The evidence for that doesn't stack up.'

But on the same day 'callous' Anderson was put behind bars, it was revealed Police Scotland took five years to try to trace a violent criminal who had breached his tagging order.

Last night, Scottish Tory justice spokesman Liam Kerr said: 'If Humza Yousaf is serious about abolishing the "soft touch" approach, cases like this will need to be stopped. This individual should never have been free to commit this crime.'

Anderson was let out early after raping a 13-year-old girl then struck again twice – the first time within a fortnight of his release.

As Anderson was handed an Order for Lifelong Restriction (OLR) yesterday, his second victim declined to comment, but a friend said the woman believed the justice system was a 'joke'.

The friend said: 'She knows prison doesn't have any effect on Anderson but how can she trust an OLR?

'She thinks Anderson is a psychopath for raping a 13-year-old girl. And yet the authorities let him out of jail early and he went on to rape two more women, including her.'