Alam admitted the attack at the High Court in Edinburgh
An illegal immigrant has admitted sexually assaulting a mother while she was sleeping in an Edinburgh flat.
Khashul Alam's 26-year-old victim had gone into a bedroom at a party to lie down because she did not feel well.
The woman, who cannot be identified, woke up to find her clothes off in the Abbeyhill flat on 23 April 2008.
Sentence was deferred at the High Court in Edinburgh for background reports. He was remanded in custody and placed on the sex offenders register.
He is next due to appear in court in January.
Advocate depute Morag Jack said Alam first approached the woman, who had been drinking, at a city nightclub.
She told the court the pair danced and flirted before continuing drinking with others at a flat in the Abbeyhill area.
Later the woman felt unwell and she went to bed.
Her friend fell asleep in the living room of the flat but was later awoken by the woman screaming.
Ms Jack said: "She realised that some form of sexual activity had occurred while she was asleep.
"She quickly got dressed and ran into the hallway in a distressed and dishevelled state."
The court heard the woman had run out into the street flagged down a car and the driver had taken her to a police station where she reported the incident.
Defence solicitor advocate Jim Stephenson told the court Alam had entered the country in July 2003 and had left Bangladesh due to difficulties.
The court also heard it was believed Alam had been employed on the black economy in Edinburgh for around 18 months.
Ms Jack added that first offender Alam had been served with a deportation notice.