An illegal immigrant from Bangladesh has admitted carrying out a sex attack on a woman in Scotland
Mofazzul Chowdhury, 34, a former chef at the town's Sunrise Restaurant, admitted assault with intent to rape in Abbey Place on 20 August this year.
Sentence was deferred at the High Court in Edinburgh for reports and Chowdhury placed on the sex offenders register.
The judge said he would also consider whether to recommend deportation. Chowdhury was remanded in custody.
The incident took place in the early hours of the morning just moments after the woman was dropped off by a taxi.
The student was grabbed by the neck from behind and forced into the alleyway before Chowdhury tried to pull down her jeans and molested her.
She managed to break free and began screaming and crying for help, the court heard.
People leaving a pub went to her aid and one of them recognised Chowdhury.
Advocate depute Peter Hammond said the Bangladeshi had moved to the Borders town from Birmingham and was staying with other restaurant workers.
He said Chowdhury had entered Britain with a valid work visa but it expired in December 2003 making him an illegal immigrant.
Foreign Criminals Of The Day, Part II - In All The Unfamiliar Places