The schoolgirl thought they were going shopping, but Ashraf drove her to the flat and began looking through her mobile phone.

He then asked her questions about photos and texts on the handset before molesting his victim.

Advocate depute David Taylor told the High Court in Edinburgh yesterday: “She told him to stop and tried to push his hands away but he was too strong.”

The court heard Ashraf ignored her protests and pushed her down and lay on top of her. The prosecutor said: “He told her the quicker she enjoyed what he was doing and the quicker she got in a good mood, the quicker he would let her go home.”

During the attack, Ashraf pulled down her trousers and lifted up her top and tried unsuccessfully to rape her.

“The victim kept on asking him if she could go home. He replied ‘No’,” said Mr Taylor.

Ashraf forced her to perform a sex act then asked her what she would tell her family had happened. Mr Taylor said: “She told him she would say that they had been shopping.”

Married Ashraf, of Netherbank, Alnwickhill, yesterday admitted the attack on the teenager on November 16, 2012 at the flat in the city. The court heard the girl went home after the attack and texted her sister, who arrived home five minutes later.

The advocate depute said: “As she approached the door, the victim came running towards her crying. The victim’s face was red and her eyes were swollen. She hugged her sister and mumbled ‘something’s

happened’.” She revealed to her sister that her attacker had kissed and touched her and “made me do things”.

A 999 call was made to police and officers attended the girl’s home and she was initially calm but became upset when explaining the details of the assault. Police went to Ashraf’s home and were told that he was out working as a taxi driver. He was later detained and taken to a police station. The court heard that Ashraf’s DNA was found on swabs taken from the girl and her DNA was present on swabs from him.

The Crown accepted his not guilty plea to behaving in a threatening or abusive manner by repeatedly phoning the girl and waiting outside her school. His not guilty plea to a further charge of behaving in a threatening or abusive manner towards another female was also accepted.

Defence counsel Frances McMenamin QC said a background report would be required on the first offender before sentencing him.

Judge John Morris QC remanded Ashraf in custody and deferred sentence until June. He was also placed on the sex offenders register.