The 29-year-old sex worker – who cannot be named for legal reasons – told a jury that a man attacked her in November 2014.
The High Court in Edinburgh heard the woman claim the man held a knife to her body and demanded she give him cash.
When she failed to give him money, he forced the mother-of-one to perform a sex act before raping her. He then forced her to perform another sex act on him.
The alleged victim told the court that her alleged ordeal seemed to last “like a lifetime”.
She added: “I felt violated and scared. I told him I had a daughter. I was crying through the whole thing begging him to stop. But he wouldn’t. It was horrible. I was scared.”
The woman was giving evidence on the first day of proceedings against 24-year-old Faizan Ali, a prisoner of HMP Edinburgh. Ali denies raping the woman on November 13, 2014. He has also pleaded not guilty to two other charges.
The woman told prosecution lawyer Shirley McKenna that the attack took place in the early hours. She told the court that she had been working in Leith as a prostitute but was getting ready to go home.
The woman told the court that a man approached her in the street and asked her for sex.
She told the court that she said she was heading home and crossed the road – however, the man followed her and spoke to her.
She said: “He said he had a £100 note. He wanted business. I asked him to show me it, but he brought out a knife.
“He brought out a knife and held it to my ribs to begin with – that’s when he asked me to get my money out. I didn’t have any money and I told him that but he wouldn’t take it for an answer. He stuck the knife into my ribs.”
The woman told the court that the man forced her to perform a sex act on him. He also searched her personal possessions and found her Post Office bank card in her belongings.
She added: “I asked him not to hurt me. I begged him. I told him I had no money.”
She said the man raped her during the incident and also forced her to perform another sex act on him. The woman told the court that she told the man that she had money in her Post Office account in a bid to stop him abusing her.
She added: “He told me that he would stab the life out of me if I didn’t get the money out of my account.”
The woman then told the court that she saw two men walking through the park and approach him. She managed to get free from the man who was attacking her.
Mr Ali is represented by solicitor advocate Brian Gilfedder. He has lodged a special defence on his client’s behalf which states that the pair had consensual sex.
The trial, before judge Lord Burns, continues.