The incident happened at around 3am yesterday (Sunday August 12) in the alley between the Black Lion public house and the NCP car park on North Street.
The victim, who is receiving support from specially-trained officers, was on her way home after a night out with friends.
She had made her way from St Thomas Street, up Newborough, and into North Street. She is believed to have been followed into North Street by her attacker.
An 18-year-old man has been arrested in connection with the investigation and is currently being detained in custody while enquiries continue.
Detective Inspector Glenn Kelly, of Scarborough Serious Crime Team, said: “Incidents such as this are extremely rare, both in Scarborough and in North Yorkshire generally.
“My team is working around the clock on this investigation. I’d urge anyone who has any information – no matter how insignificant it may seem – to get in touch if they’ve not already done so.”
If you have any information, please contact Scarborough Serious Crime Team on 01609 643251 and quote reference 12180149427.