Hemed was sentenced at the High Court in Glasgow
A man who drugged and raped two women after being granted bail, and intended to rape two more, has been jailed for nine years.
Abdalla Ali Hemed attacked and raped one of his victims less than 24 hours after being granted bail in Aberdeen.
Hemed, 44, a Somalian refugee, was found guilty of the attacks, which happened between 2004 and 2006.
Judge Lord Bracadale told him, at the High Court in Glasgow, that he posed a danger to women.
He had been allowed to stay in Scotland on indefinite leave after fleeing from the military regime in Somalia.
However, after arriving in Aberdeen, he carried out the sexual attacks over three years before he was caught.
In his first attack, Hemed struck along with an unknown gang of men, and attacked a woman at a flat in Great Northern Road on 23 and 24 July, 2004.
Hemed removed her clothing, lay on top of her while she was unconscious, then raped her when she regained consciousness. He had been granted bail at Aberdeen Sheriff Court on 5 August, 2003.
On 2 August, 2006, Hemed attacked and raped another woman in a flat in Canal Place after giving her drugs.
He held a knife against her throat and held her down during the attack.
He had been granted bail the day before.
On 4 December, 2006, Hemed carried out another sex attack on a woman in his flat in Canal Street.
He seized hold of her, pinned her against a wall and held her captive in his flat. He then chased her with the knife with intent to rape her.
Hemed was still on the 1 August bail order at the time.
Less than a week later - on 12 December - he carried out another sex attack at knifepoint in his flat.
He pulled a knife on a fourth victim and demanded that she strip off her clothing, then he pushed her repeatedly and grabbed her.
As the woman broke free and tried to run away, Hemed chased her with the knife with the intention of raping her.
Hemed was also found guilty of breaching the peace at Northsea Court in Aberdeen on 27 September, 2007.
He tried to leave a flat with a knife and told police officers that he was on his way to a nearby flat to kill the person who lived there.
Hemed was caught after one of his victims went to the police and reported what he had done.
Det Insp Andy Imray, of Grampian Police, said: "It was very brave indeed for the victim to come forward. It was obviously a very difficult thing to have to relive in front of strangers."