A man with a history of violence who subjected a young woman to a "prolonged and terrifying" rape ordeal has been jailed for nine years.

The victim was walking home in Aberdeen when she was abducted and raped by William Fraser, described by police as ruthless.

During the attack, Fraser, now 22, threatened to kill his victim and forced her to clean herself with a mop in an attempt to get rid of any forensic evidence.

The violence he subjected her to caused her to pass out for a time and she was left distraught and severely injured.

The judge who sentenced him, Lady Scott, said: "This is the kind of attack which restricts the liberty of all women by placing every woman in fear of her safety in the public streets."

She imposed a 13-year extended sentence at the High Court in Aberdeen, involving a nine-year jail term and a further four years of supervision upon his release.

Details of the sentence were revealed after the hearing by the Crown Office and the Judiciary of Scotland.

The investigation into the crime was one of the largest in recent times for the then Grampian police force, with more than 130 officers reportedly involved.

Fraser, of Aberdeen, was convicted after a trial in November of raping the 22-year-old Polish woman on October 27 2012.

The court heard that Fraser pounced on his victim from behind in the early hours.

He pushed her to the ground, struck her repeatedly in the face and robbed her of money, a phone and cards. He then hit her with a metal bicycle chain and she passed out for a period of time.

When she woke, he hit her, racially abused and threatened her and sexually assaulted her. He then pulled her to a secluded area, where he raped her.

He later dragged her to a nearby tenement block and made her clean herself with a mop, in an apparent bid to remove any forensic evidence.

Passing sentence, Lady Scott told him: "Your victim was left utterly distraught and severely injured. She remains traumatised and has difficulty in coping. It is to her immense credit that she has resumed her full-time studies and has tried to rebuild her life.

"In her evidence, your victim said she was not worried about walking home alone because she felt Aberdeen was the safest place in the world. Among the many things you robbed your victim of that night was that trust and her generosity of spirit."

Fraser was on bail at the time of the attack and has a criminal record which includes numerous convictions for violence and for racially aggravated behaviour, the judge said, although they did not approach the degree of violence shown in this case.

Background reports prepared for the court found that Fraser presents a high risk of serious harm to the public. A report by a psychologist said he has personality and psychopathic traits which increase the risk he presents.

"That you present a risk of serious harm to women is obvious from the severity and circumstances of this attack," said the judge.

"The appalling nature of this attack requires a substantial period of custody."

Fraser has been placed on the sex offenders register indefinitely.

Speaking after sentencing, Andy Shanks, High Court procurator fiscal for the north of Scotland, said: "This was a despicable attack on a defenceless young woman, picked at random as she walked home from work. William Fraser will now face many years behind bars as a consequence of his actions.

"Prosecutors take the crimes of rape and sexual offences extremely seriously and are committed to ensuring that all such cases are investigated thoroughly and prosecuted appropriately."

Detective Superintendent Martin Dunn, of Police Scotland, said: "We welcome the sentencing of William Fraser today following one of the largest investigations conducted by the then Grampian Police.

"This was an horrific attack by someone who has shown no remorse for his actions throughout our investigations and the court proceedings.

"I want to commend the courage of the woman who came forward and again thank the community and our partners for their support in bringing this investigation to a successful conclusion. I hope that the sentencing result today gives some closure to the woman."