A teenager has been sentenced to three years in prison for raping a girl when she was just 12.

Myles Harris was 18 when he assaulted the girl at Gala Policies park in Galashiels, in the Scottish Borders, last year, the High Court in Edinburgh was told.

Judge Lord Scott said that but for Harris' plea of guilty, the custodial term would have been four years and six months.

The court heard Harris, who has since turned 19, had “no memory” of the offence as he was heavily intoxicated at the time.

READ MORE: Man charged charged in connection with death in Edinburgh

Defence counsel Lili Prais explained Harris had started misusing substances aged 12 and this escalated as he grew older.

She said he then fell in with a bad crowd and went on make some “extremely poor” life choices, leading to the rape on January 16 last year.

She told the court: “He is devastated by the actions of that night. He accepts full responsibility.

“He has no memory of the incident. He had consumed substances.

“He no longer misuses drugs or alcohol. He is no longer associating with negative peer groups.”

Ms Prais said Harris has moved to Canterbury, Kent, to stay with his grandparents and is willing to participate in any programme the court feels could help his rehabilitation.

“There is no better example of capacity to show change,” she said.

Judge Scott said a custodial sentence was justified considering the seriousness of the offence.

“You raped a child when you were 18 and she was only 12,” he said. “You knew her age.”

The judge went on to refer to a victim impact assessment which said the child Harris raped continues to suffer “serious” and “ongoing” effects from her experience on a “daily” basis.

He also told Harris that being under the influence of drink or drugs at the time of the offence made no difference to his deliberations.

“I must make clear the usage of alcohol or drugs provides you with no excuse or mitigation at all,” he said.

Harris, who admitted the offence and appeared in the court by video-link from custody, was told his three-year sentence would be backdated to the day he was taken into custody last month.

He was also placed on the sex offenders register indefinitely.