A Fringe performer said a stranger he met during the Edinburgh Festival raped him in a graveyard.
Rachid Lamrabet, 42, is accused of raping the man to his injury at Greyfriars Kirk on 26 August 2015.
Mr Lamrabet, a native Spanish speaker from London, denies the charge and has lodged a special defence claiming the complainer consented to sex.
The trail at the High Court at Livingston, before Lord Woolman, continues.
The 23-year-old admin worker said he clearly remembered being raped and asked his attacker to stop.
The contemporary theatre graduate from Manchester said he ran half naked from the graveyard to escape his attacker.
He claimed he recalled nothing else until he woke up in an ambulance.
Giving evidence from behind a screen in court, the man said he had come to the Scottish capital with friends to perform in a show at the Edinburgh Festival Fringe in August 2015.
He said he had gone out socialising in the city centre with his friends after they had finished a performance.
He admitted he had had at least 10 drinks before he left the Hive nightclub in Niddry Street alone, and identified himself on CCTV stumbling drunkenly outside the club and dropping his mobile phone several times.
The jury also saw CCTV footage of the alleged victim wandering the streets around the Cowgate area before apparently approaching a man in the street outside the rear of the Budget Backpackers' hostel near Grassmarket.
Hand in hand
He confirmed that video shown in court showed him and the other man "kissing and embracing" each other before setting off down the street hand in hand.
The alleged victim is then captured by another CCTV camera at the Greyfriars Bobby Bar with his right arm around the neck of an older man as they walk together towards the churchyard.
He agreed with advocate depute Tim Niven-Smith that he had met the person seen on the court TV screens and "gone off willingly somewhere with them".
Mr Niven-Smith said: "Clearly you are agreeing with what is happening at that point; you're consenting to what is happening, approving, going along." He replied: "Yes."
He said he was then raped in the churchyard.
He said he had suffered "intimate" injuries as a result of the rape.
He said he had no memory of meeting two "Good Samaritans" who called an ambulance after they found him lying in his underpants at a bus stop on George IV Bridge across from the churchyard shortly before 06:30.