Felix “Joe” Tsotoovor faces being deported after he has served his prison sentence for the sex crimes he has committed.
Tsotoovor, 40, was led to the cells at the High Court in Edinburgh with calls of “justice” from one woman in the public benches.
A judge told the rapist: “These are serious crimes which require me to impose a substantial custodial sentence.”
Lady Scott said the rape victim now suffers from depression and as a result lost her employment and added: “She has lost trust in others and confidence.”
The judge pointed out that Tsotoovor had persisted in his attack on the expectant mother despite her telling him “no”.
She said that Tsotoovor had taken the 12-year-old girl to his empty workplace at a building site in Dalkeith, in Midlothian, and carried out a sexual assault on the child.
“You only stopped when your victim, with admirable bravery and spirit, fought you off,” said the judge.
The judge told the sex offender that he had “robbed her of the innocence of childhood”.
She told the West African that she took into account he was a first offender and that he would be liable to be deported at the conclusion of his prison sentence.
Tsotoovor, formerly of Green Park, in Edinburgh, was told that he would be put on the sex offenders’ register for an indefinite period.
Tsotoovor had denied raping the woman at a house in Edinburgh in 2010 and carrying out an assault with intent to rape on the girl in 2012, but was found guilty at an earlier trial.
During the rape Tsotoovor sexually assaulted the woman, ignored her pleas to stop and pinned her down on a bed.
The 41-year-old victim told the court that she had been asleep when the attack began and said: “He pulled my pyjamas down and got on top of me.”
Defence solicitor advocate Gerard Brown said that Tsotoovor had instructed solicitors to deal with any pending immigration proceedings.
He said the lawyers would have to decide whether to challenge any Home Office decision to remove him from Britain following his conviction for the sex crimes after taking his instructions.