Drug dealer John Tunnicliffe raped three women and sexually assaulted a man during a string of attacks he perpetrated in the Borders.
The High Court in Edinburgh heard that Tunnicliffe, 56, targeted the vulnerable that he came into contact with through his activities as a drug trafficker.
Tunnicliffe, formerly of Hawthorn Road, Galashiels, had earlier denied a string of charges at a trial, but was found guilty of four offences of rape and a further four of sexual assault.
Judge Fiona Tait ordered that in addition to the 12-year prison term he should be kept under supervision for a further four years.
The registered sex offender first struck during an incident between August 1993 and July 1994 when he picked up a teenage girl and offered her drink. He got her wine and drove her in a car to a remote spot before taking off her leggings and climbing on top of her. She felt ill and was sick and told him she did not want it, but he ignored her and raped her.
More than two decades later, Tunnicliffe assaulted and raped her again after the victim developed a drug problem. He subjected her two rapes and repeatedly committed sex attacks against her in 2017 and 2018.
The woman said: "He was the one with the drugs and he was the one offering the drugs and I was a drug addict."
She said that on some occasions when she met him she was "desperate for a fix".
Another woman, aged 38, said she was repeatedly groped by the dealer. She was also raped by him after he gave her a powder at a house in Galashiels which left her feeling sleepy. She saw him sexually molest a man and told him he was "a dirty bastard".
A 25-year-old woman said that she regularly sourced heroin from Tunnicliffe in 2016 and 2017, but he also subjected her to sex attacks and a rape.
During the rape he took her to a flat in Galashiels High Street in 2017 and grabbed her wrist, dragged her upstairs and pushed her onto a bed.
The woman said she tried to resist, but he was bigger than her. She said her attacker could see that she was upset, but ignored it.
Advocate depute Steven Borthwick said: "He took what he wanted regardless of the wishes of these women."
The prosecutor said Tunnicliffe targeted vulnerable people he came into contact with through his activities as a drug dealer. He said: "Each of the complainers had their own struggles with substance abuse."
Tunnicliffe, who was jailed for four and a half years in 2007, was placed on the sex offenders' register.