A repeat sex offender who committed a series of attacks on women and girls over 13 years has been jailed for an indeterminate period.

Brian Mackenzie was convicted of a catalogue of sexual and physical offences against six victims in "a series of evil crimes" at addresses in Edinburgh and Glenrothes, Fife.

The 40-year-old was placed on the sex offenders register after being found guilty of rape, attempted rape, under-age sex, indecency and assault at a trial at the High Court in Edinburgh last April.

On Friday, Lord Uist imposed an order for lifelong restriction on Mackenzie.

This means that he will only be released if he is no longer seen as a risk to the public, and he will have to serve at least seven years before he can apply for parole.

Mackenzie was found guilty of a total of nine sex offences against three women and three children and physical violence towards three women after a five-week trial at the High Court in Edinburgh.

He was acquitted of further charges on a string of not guilty and no proven decisions.

"Two of your victims were children aged eight and ten. The appalling nature of your crimes is self-evident from the terms of the charges of which you were convicted," Lord Uist told Mackenzie on Friday.

"You have a complex and severe personality disorder. It is clear that you are callous and have no concern for your victim.

"Two accredited risk assessors have assessed you as posing a high risk to the safety of the public at large. I am in no doubt that you are a serious danger to females."

Mackenzie attacked his first victim in 2000 and she was repeatedly struck on the head and hit with a vacuum attachment.

He tried to strangle her and pushed her and locked her out his flat in Craigmillar, Edinburgh. Another woman was subjected to a rape bid at the flat.

Mackenzie went on to have under-age sex with a 15-year-old girl at a bed and breakfast in Leith and carried out sexual acts with her.

He later attacked the same teenage girl and pinned her to the floor as well as grabbing her by the throat and striking her on the head while she was holding a baby.

The 40-year-old later raped another woman at a flat in Edinburgh, sexually assaulted her with his fist and repeatedly tried to strangle her.

The woman was also raped during an attack in which she repeatedly told him to stop but Mackenzie continued, ignoring her crying. He attempted to rape her again on a separate occasion.

Mackenzie was also convicted of molesting a girl who was aged ten and 11, and and another child who was 12-years-old, at a house in Glenrothes in 2012 and 2013.