James Grieve Donaldson, also known by the surname Murray, was found guilty of four charges following a trial at the High Court in Glasgow.
The court heard how the 59-year-old sexually abused two children between 1991 and 1995.
He targeted both boys at various locations in the Dundee area, including inside his vehicle and home.
Donaldson was also found guilty of sexually assaulting an adult male, who was asleep and unable to consent, on an occasion in 2018.
On 9 September 2025, at the High Court in Glasgow, Donaldson was made subject to an Order for Lifelong Restriction (OLR).
He must serve a minimum of two years and six months in custody before he can be considered for release into the community by the Parole Board.
His name has been added to the sex offenders register indefinitely with an indefinite non-harassment order also granted.
Fiona Kirkby, Procurator Fiscal for High Court Sexual Offences, said:
"James Donaldson is a dangerous individual who inflicted unimaginable trauma through his depraved offending.
"He will now face the consequences of his actions following this prosecution, which would not have been possible without those who reported him.
"We recognise the impact that crime and involvement in the justice system have on victims and work hard to support them through the process.
"I would urge any victim of sexual offending to report it, regardless of how long ago it took place. Our prosecutors will use every tool available as we seek to ensure that justice is served."
Police Scotland Detective Constable Rachael Clark said: "It is very difficult to speak about these types of crimes, and I would like to thank the victims in the case for the strength shown during our investigations.
"Donaldson subjected his victims to sexual abuse over the years, and his sentencing sends a clear message that anyone found to be involved in this type of behaviour will be brought to justice.
"We are committed to supporting victims of sexual crimes, no matter how much time has passed. I urge people to come forward to police and report it. They can be assured of being fully supported by officers and partner agencies."