Douglas Ewen was warned he will only be freed if the authorities consider it is no longer necessary for the protection of the public that he be kept in jail.
Ewen, 59, inflicted a catalogue of sexual and physical harm on victims beginning when he was only 15 years of age.
A judge at the High Court in Edinburgh told him: “There is clearly no alternative to a custodial sentence. No other method of dealing with you is appropriate.”
Lord Kinclaven said he had reached the view that the risk criteria were met for imposing an Order for Lifelong Restriction (OLR) on Ewen.
Under an OLR the court sets a minimum period the offender must spend in prison but any future release is left to the parole authorities.
Lord Kinclaven told Ewen that he would fix the punishment part that he must serve at five and a half years.
But the judge told him: “Please be clear that that does not mean that at the end of that period of five years and six months that you will be released.”
The judge said he had read a victim impact statement from one woman who was abused and raped by Ewen as a child which set out the emotional and psychological impact of his offending on her.
Lord Kinclaven said that an expert who prepared a report on Ewen had reached the conclusion that he presented a high risk.
Ewen, a prisoner in Grampian jail, was found guilty of 18 offences involving ten victims last year following a trial at the High Court in Aberdeen.
His catalogue of crime included child rape, rape of women, sexual and physical assault and threatening behaviour.
Most of his offending took place at addresses in Aberdeen but other incidents happened at different locations in north east Scotland.
His crimes began in 1974 when he was a teenager as he physically assaulted a female in the Balnagask area of the city and repeatedly punched her. In 1976 he started committing sex crimes after targeting a little girl whom he molested from the age of five before later raping her.
Defence counsel David Moggach said Ewen still maintained that he was innocent of the charges a jury convicted him on.
Ewen was previously placed on the sex offenders’ register.