A rapist who sent a text message to his victim to say he was sorry has been jailed for five years.
Rohan Costa, 35, of Dumfries, attacked the 17-year-old at a house in the town in September 2016.
He was found guilty of the rape by a jury at the High Court in Edinburgh last month.
Appearing at the High Court in Glasgow for sentence he was given a prison term and placed on the sex offenders register indefinitely.
It emerged that a pre-sentencing report had discussed the possibility of the sex attacker not being jailed for the offence.
However, Lord Armstrong said: "The crime of rape is a grave one and all women should be protected."
He added the victim had been "vulnerable" and that Costa had taken advantage of her.
The judge also told Costa: "You sent a series of text messages asking to be forgiven.
"You continue to deny responsibility for your conduct.
"It is noted that you lack any empathy for your victim."
His trial heard how another man who had been in the house where the rape took place had been wakened by a distressed woman yelling "get off me" and "stop it".
He went into the living room and discovered the victim in tears before calling 999.
Costa later sent the teenager a text stating: "I am sorry. I was drunk and I was excited."
Matt Jackson, defending, said the possibility of a "non-custodial disposal" had been raised in a background report for the hearing.
However, the advocate accepted it would not be "competent" for him to suggest that option given the crime.
Mr Jackson added: "He maintains his position of denial.
"He has struggled enormously being in prison."